Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Could you add random tests to the translation?
Fixed
Not an issue
Your solution may be off-by-one. Or the kata might be, I'm really not sure anymore.
Provided test cases in the Ruby kata are incorrect.
28! is 304888344611713860501504000000; it ends in 6 zeros.
30! is 265252859812191058636308480000000; it ends in 7 zeros
36! is 371993326789901217467999448150835200000000; it ends in 8 zeros.
http://keisan.casio.com/calculator
JavaScript. Actually, I tried it again last night, and I was able to get it to work. Bizarre...
Interesting... Which language are you using?
Can't access Math?
@mattbrendzel, @nbeck the problem lies with the parentheses on the class name Sudoku() and passing self as parameter to the method. Try removing these. Also, write an initialize method.
Same here, have you find something ?
Getting syntax errors in Ruby - it's reporting a mysterious
\n
that it doesn't like and that I can't seem to find.This comment is hidden because it contains spoiler information about the solution
Damn, that's a beautiful solution. Didn't even occur to me to use .scan, and it makes way more sense to calculate averages using overall sums like this.
Yes, you are right. I'll modify the description. The algorithm must be greedy: at each stage one must find the biggest square that can be used in the sum of squares.
For example if n=11, n^2=121 and at least I have two decompositions: [1 2 4 10] and [2 6 9]. I keep [1 2 4 10] because 10^2 is bigger than 9^2 to remove from 121.
For the decomposition of 50^2, I have the solution [1,3,5,8,49] which is "greedy" because 49^2 is bigger to remove from 50^2 than 48^2 or worse 40^2.
Hopefully it would be more precise. Thanks for the help.
This comment is hidden because it contains spoiler information about the solution
Loading more items...