Skip to content

Instantly share code, notes, and snippets.

@antsmartian
Created February 12, 2012 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antsmartian/1808930 to your computer and use it in GitHub Desktop.
Save antsmartian/1808930 to your computer and use it in GitHub Desktop.
Top coder problem solution
//http://cse0812.blogspot.in/2012/02/problem-from-top-coder.html
def a = [".15", "7..", "402", "..3"]
c = a.permutations() as List
ans = []
c.each {
ans << it.join().tokenize('.')*.toList().collect{ it*.toInteger().sum() }
}
println ans.flatten().max()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment