Skip to content

Instantly share code, notes, and snippets.

View yoaquim's full-sized avatar

Yoaquim Cintrón yoaquim

View GitHub Profile
@yoaquim
yoaquim / web1&2(challenge).js
Last active August 29, 2015 14:01
Programming Excercise
/*
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)
@yoaquim
yoaquim / general2.rb
Last active August 29, 2015 14:01
Programming Exercise
=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!”
@yoaquim
yoaquim / general3.js
Last active August 29, 2015 14:01
Programming Excercise
/*
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: