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 list of times in a 24-hour period, return the smallest interval between two | |
| times in the list. Hint: you can do this in O(n) time! | |
| Example: | |
| $ smallestTimeInterval(['01:00', '08:15', '11:30', '13:45', '14:10', '20:05']) | |
| $ '25 minutes' |
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
| import os.path | |
| from os import path | |
| import csv | |
| question = """ | |
| Implement a hashmap from scratch without any existing libraries in your preferred language. | |
| A hashmap should: |
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 2D array of 0s and 1s, return the size of the largest rectangle of 1s in the array. | |
| Example: | |
| let islands = [ | |
| 0,0,0,1,0 | |
| 1,1,0,0,1 | |
| 1,1,0,0,0 |
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 array of integers, find the length of the longest sub-sequence such that elements | |
| in the sub-sequence are consecutive integers, the consecutive numbers can be in any order. | |
| Example: | |
| $ longestSubSeq([1, 9, 87, 3, 10, 4, 20, 2, 45]) | |
| $ 4 // 1, 3, 4, 2 |
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 QWERTY keyboard grid and a remote control with arrows and a “select” button, write a | |
| function that returns the buttons you have to press to type a certain word. The cursor will always | |
| start in the upper left at the letter Q. | |
| Example: | |
| $ remoteControl('car') | |
| $ 'down, down, right, right, select, left, left, up, select, up, right, right, right, select' |
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 = """ | |
| Implement a word search. Given a 2D array of letters and a word to find, | |
| return the 2D array with the found word's letters replaced with an asterisk (*). | |
| Example: | |
| let grid = [['a','a','q','t'], | |
| ['x','c','w','e'], | |
| ['r','l','e','p']] |
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 array of people and their timezones in UTC, write a function to return the local | |
| time for a given person. Extra credit: add options for a 12 or 24 hour clock! | |
| Example: | |
| let humans = [ | |
| { name: 'Clara', timezone: 'UTC−4:00' }, | |
| { name: 'Cami', timezone: 'UTC−7:00' } | |
| { name: 'Ximena', timezone: 'UTC−5:00' } |
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 are given three files named first_page.txt, second_page.txt, and third_page.txt | |
| with the occurrence of at least one palindrome in each of them. Write a script to find the following: | |
| The exact number of palindromes in each file. | |
| The line numbers of the palindromes in each file. | |
| """ | |
| import re |
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 = """ | |
| Using the rules of Wordle, given a guessWord and a solutionWord, | |
| return a set of emojis returned from the guessWord. | |
| Example: | |
| let solutionWord = "fudge" | |
| $ wordleGuess("reads", solutionWord) |
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, you can transform every letter individually to be lowercase or | |
| uppercase. Return a list of all possible permutations you could create from s. | |
| Example: | |
| $ capPermutations("ab2") | |
| $ ["ab2","aB2","Ab2","AB2"] | |
| $ capPermutations("35p") |