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 set of letter grades, output the GPA (grade point average) of those grades. | |
Key and examples: | |
A = 4 grade points | |
A- = 3.7 grade points | |
B+ = 3.3 grade points | |
B = 3 grade points | |
B- = 2.7 grade points |
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 fromTo that produces a generator, that will produce values in a range. | |
Usage: | |
let gen = fromTo(5,7) | |
> gen() | |
5 |
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 that represents a markdown table, | |
return a formatted markdown table. A formatted markdown | |
table means that the width of each column is the width of | |
the longest cell in the column. | |
Example: | |
Input: | |
| Syntax | Description | |
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 consisting of various parenthesis ( and ), | |
find the length of the longest valid parenthesis substring. | |
Example: | |
> parensSubstring('(()(') | |
> 2 | |
> parensSubstring(')()(()))') |
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 that has a valid email address, write a function to hide | |
the first part of the email (before the @ sign), minus the first and last | |
character. For extra credit, add a flag to hide the second part after the | |
@ sign to your function excluding the first character and the domain extension. | |
Examples: | |
> hideEmail('[email protected]') |
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 = """ | |
The game Rummikub has 106 tiles: 8 sets numbered 1-13, colored | |
red, blue, black, and yellow, and two (2) “wildcard” tiles. | |
Write two functions: one that creates a new player's tray of | |
14 tiles (repetitions allowed), and one that returns the valid | |
sets from a given tray. A set can be either 3 or 4 tiles of the | |
same number (but all different colors), or it can be a “run” | |
(which is three or more consecutive numbers all in the same color). | |
The rules for Rummikub are here if you need more clarification! |
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 str and a set of words dict, find the longest word in dict that is a subsequence of str. | |
Example: | |
let str = "abppplee" | |
let dict = {"able", "ale", "apple", "bale", "kangaroo"} | |
$ longestWord(str, dict) |
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 Fibonacci number, give the previous Fibonacci number. | |
If the number given is not a Fibonacci number, return -1. | |
""" | |
def prevFib(number): | |
fibs = [ 0, 1 ] | |
answer = None |
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 = """ | |
Create a loooong teeeext generator that takes in a string and an integer n, | |
and multiplies the vowels in the string by n. | |
Example: | |
$ longText('hello world', 3) | |
$ 'heeellooo wooorld' |
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 that determines if all the characters in a given string | |
are unique. Can you do this without making any new variables? You choose | |
if you want to include capitalization in your consideration for this one, | |
as a fun challenge. | |
Example: | |
> allUnique('Cassidy') |