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
/* | |
Exercise: | |
Write a web based math engine. It should take the form of a running web service | |
that takes in a single parameter GET or POST* called “values”, which is a | |
JSON-formatted list of numbers. The response should be a JSON dictionary with | |
two values, the “sum” and the “product”. | |
Example input: “values” = [1, 4, 7, -2] (will be either a url param for a GET | |
or a post param for POST) |
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
=begin | |
Exercise: | |
Write a function that takes a string and returns a rot13 version | |
of that string with every other word reversed. If the function is | |
f, f(f(x)) should return x. Remember to take non-alphanumeric | |
non-alphanumeric characters into account. | |
Example Input: “Hello world!” |
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
/* | |
Exercise: | |
Write a function that takes in a number N and counts | |
how many numbers between 1 and N (inclusive) do not | |
contain any digits which are ’7′. | |
*/ | |
//Recursively, it comes out somewhat nice and clean: |