This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """An “odious number” is a non-negative number that has an odd number of 1s | |
| in its binary expansion. Write a function that returns true if a given number is odious. | |
| Example: | |
| $ isOdious(14) | |
| $ true | |
| $ isOdious(5) | |
| $ false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| Given an integer array, find all distinct combinations of a given length x (with repetition allowed). | |
| Example: | |
| $ distinctCombos([1,1,2], 2) | |
| $ [1, 1], [1, 2], [2, 2] | |
| $ distinctCombos([1,2,3,4], 2) | |
| $ [1, 1], [1, 2], [1, 3], [1, 4], [2, 2], [2, 3], [2, 4], [3, 3], [3, 4], [4, 4] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| Given a string of HTML, detect and print all the HTML tags, attributes and values of attributes. | |
| Example: | |
| $ parseHTML(`<p><img src="https://i.imgur.com/LSG9xg3.jpeg" /></p>`) | |
| $ [{ tag: 'p' }, { tag: 'img', attributes: [{'src': 'https://i.imgur.com/LSG9xg3.jpeg'}] }] | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. | |
| Example: | |
| $ formParens(1) | |
| $ ["()"] | |
| $ formParens(3) | |
| $ ["((()))","(()())","(())()","()(())","()()()"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| Given two non-negative integers n1 and n2 represented as strings, | |
| return the product of n1 and n2, also represented as a string. | |
| Twist: You can’t use any built-in language integer libraries nor | |
| convert the inputs to integers directly. | |
| Example: | |
| $ stringProduct("123", "456") | |
| $ "56088" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| Write a function to find the longest common prefix string in an array of strings. | |
| Example: | |
| $ longestPrefix(["cranberry","crawfish","crap"]) | |
| $ "cra" | |
| $ longestPrefix(["parrot", "poodle", "fish"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| You need to get the top 5 GitHub OSS code repositories that make use of the | |
| navigator.sendBeacon Web API. How would you go about it? | |
| """ | |
| import requests | |
| import re | |
| url = 'https://github.com/miguelmota/Navigator.sendBeacon/network/dependents' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question= """ | |
| Given a string s, return the longest palindromic substring in s. | |
| Example: | |
| $ pSubstring('babad') | |
| $ 'bab' // or 'aba' | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """Given a grid size, and a set of mines (in pairs of rows and columns), | |
| generate the Minesweeper grid for that set of mines. You can use asterisks for mines, | |
| and an x for 0! | |
| Example: | |
| let gridSize = 5 | |
| let mines = [[1, 3], [3, 5], [2, 4]] | |
| $ generateMinesweeper(gridSize, mines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| question = """ | |
| Given a positive integer n, write a function that finds | |
| the number of zeros at the end of n! in base 10. | |
| Example: | |
| $ zerosEndingFactorial(1) | |
| $ 0 |