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.
This comment is hidden because it contains spoiler information about the solution
I passed all tests, but cannot attempt. Why?
Strange with Swift.
Tests with very large numbers do not pass. In Xcode, for example, the number 35875699062250035 outputs as false. Moreover, if I do print, then the last received number, which is raised to a power, differs by 2 digits - 35875699062250037
Does anyone know what the problem is?
I'm stuck on this with Swift. My code passes all tests except for very large numbers apparently:
Full Tests
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 35875699062250035
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 4498128791164624869
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 4929273885928088826
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 21897142587612075
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 1517841543307505039
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 35641594208964132
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 3289582984443187032
When I logged my output I saw that I have rounding errors, for example:
9 ^ 19 = 1350851717672992089
But Swift returns 1350851717672992000
Has anyone had the same problem? Any tips?
Actual and expected are swapped in PHP, also assertion messages are not filled in completely for all test cases
Hi Julian,
Would you please be so kind to let me know what you think about the proposal of hardening tests in all languages of this kata so only O(1) solutions pass?
Thanks!
Hello Everyone. I am trying to solve Java approach for this task. I have prepared my solution and the outcome is rather interesting.
So during test I pass all possibles. After that, when I take attempt I fail ONLY at one test:
testRandomWithTriples -> expected:<200> but was:<0>. I consider this is quite fascinating that ALL OTHER TESTS are green, while this one is failing. Also - I am unable to pinpoint possible combination of dices. According to IJ:
System.out.println("Greedy points = " + greedy(new int[]{1,5,2,3,5}));
System.out.println("Greedy points = " + greedy(new int[]{2,2,2,4,3}));
System.out.println("Greedy points = " + greedy(new int[]{5,5,1,2,3}));
System.out.println("Greedy points = " + greedy(new int[]{1,1,4,2,3}));
System.out.println("Greedy points = " + greedy(new int[]{2,2,2,2,3}));
System.out.println("Greedy points = " + greedy(new int[]{2,2,2,2,2}));
All returns 200.
Thank you kindly in advance for your help and taking a look in this matter.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Go translation
This comment is hidden because it contains spoiler information about the solution
Nim: no sample tests
No random tests in :
This comment is hidden because it contains spoiler information about the solution
Loading more items...