Created
May 27, 2015 17:13
-
-
Save erukiti/a3994b5d706d645a88e2 to your computer and use it in GitHub Desktop.
This file contains 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
#! /usr/bin/env coffee | |
solver = (n, s)-> | |
if n == 10 | |
console.log(s) if eval(s) == 100 | |
return | |
solver(n + 1, s + '+' + n) | |
solver(n + 1, s + '-' + n) | |
solver(n + 1, s + n) | |
solver(2, '1') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment