Created
August 27, 2011 01:45
-
-
Save torus/1174848 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
// http://community.topcoder.com/stat?c=problem_statement&pm=11509 | |
var results = {}; | |
for (var i in a) { | |
for (var j in b) { | |
for (var k in c) { | |
var val = a[i] + b[j] + c[k]; | |
var origval = val; | |
while (val % 10 == 5 || val % 10 == 8) {val = (val / 10)|0} | |
if (val == 0) {console.log(origval, i, j, k);results[origval] = true} | |
}}} | |
var dest = 0; for (var i in results) {dest++}; console.debug(dest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment