There are already fixed tests with negative numbers, your solution will also return false (which is correct) for n = -5 / n = -6 because when x = 2, -6 != 2 * 3 for both cases above.
The tests being random sometimes you pass, sometimes you don't... When you don't pass it is because you go a step too far: once the number you get has 2 digits you should stop. The description says: "you can stop when this number has at most 2 digits because you are supposed to know if a number of at most 2 digits is divisible by 7 or not". Example: 1119559 Expected: [91, 4], instead got: [7, 5]; you should have stop with [91, 4]. I hope I'm clear enough... Anyway thanks for your post.
I cannot reproduce the error, as it correctly returns false in my test code. I would assume that you modified somehow the array in place, which is bad practice.
Btw, deployed a fix to prevent also this kind of occurrences.
There are already fixed tests with negative numbers, your solution will also return
false
(which is correct) forn = -5
/n = -6
because whenx = 2
,-6 != 2 * 3
for both cases above.Re-raised issue with details about the problem.
Marking issue as fixed.
The tests being random sometimes you pass, sometimes you don't... When you don't pass it is because you go a step too far: once the number you get has 2 digits you should stop. The description says: "you can stop when this number has at most 2 digits because you are supposed to know if a number of at most 2 digits is divisible by 7 or not". Example:
1119559
Expected: [91, 4], instead got: [7, 5]; you should have stop with[91, 4]
. I hope I'm clear enough... Anyway thanks for your post.67 guys passed the Ruby kata; yes all tests are OK.
I cannot reproduce the error, as it correctly returns
false
in my test code. I would assume that you modified somehow the array in place, which is bad practice.Btw, deployed a fix to prevent also this kind of occurrences.
@GiacomoSorbi, can you please have a look over the Ruby translation tests?