Not a bad kata idea per se, but like all katas, this one too requires random tests.
When implementing the random tests, always pass a copy of the input to the function to avoid input manipulation.
Great translation, approved.
This comment is hidden because it contains spoiler information about the solution
Tagged.
.
Yep, works now.
Overly tight error margins: expected 843253.1448715855 to be close to 843253.1448715873 +/- 1e-9
expected 843253.1448715855 to be close to 843253.1448715873 +/- 1e-9
https://www.codewars.com/kata/5a77f725b17101edd5000020/ is the same problem with similar complexity requirements, although it only asks for the optimal time, not for an associated solution sequence.
I don't get the test case height: 1, width: 1, y: -4, x: -9, thought: 'Mirrors'
height: 1, width: 1, y: -4, x: -9, thought: 'Mirrors'
At time t = 0, the text 'M' starts at y = -4, x = -9 and does not appear in the view.
y = -4, x = -9
At time t = 1, the text 'Mi' starts at y = -3, x = -8 and does not appear in the view.
y = -3, x = -8
At time t = 2, the text 'Mir' starts at y = -2, x = -7 and does not appear in the view.
y = -2, x = -7
At time t = 3, the text 'Mirr' starts at y = -1, x = -6 and does not appear in the view.
y = -1, x = -6
At time t = 4, the text 'Mirro' starts at y = 0, x = -5 and does not appear in the view.
y = 0, x = -5
At time t = 5, y > 0 and the text can no longer enter the view.
y > 0
Thus, I return 0n, but the test expects 5n. Why?
0n
5n
Loading collection data...
Not a bad kata idea per se, but like all katas, this one too requires random tests.
When implementing the random tests, always pass a copy of the input to the function to avoid input manipulation.
Great translation, approved.
This comment is hidden because it contains spoiler information about the solution
Tagged.
This comment is hidden because it contains spoiler information about the solution
.
This comment is hidden because it contains spoiler information about the solution
Yep, works now.
Overly tight error margins:
expected 843253.1448715855 to be close to 843253.1448715873 +/- 1e-9
.
This comment is hidden because it contains spoiler information about the solution
https://www.codewars.com/kata/5a77f725b17101edd5000020/ is the same problem with similar complexity requirements, although it only asks for the optimal time, not for an associated solution sequence.
This comment is hidden because it contains spoiler information about the solution
I don't get the test case
height: 1, width: 1, y: -4, x: -9, thought: 'Mirrors'
At time t = 0, the text 'M' starts at
y = -4, x = -9
and does not appear in the view.At time t = 1, the text 'Mi' starts at
y = -3, x = -8
and does not appear in the view.At time t = 2, the text 'Mir' starts at
y = -2, x = -7
and does not appear in the view.At time t = 3, the text 'Mirr' starts at
y = -1, x = -6
and does not appear in the view.At time t = 4, the text 'Mirro' starts at
y = 0, x = -5
and does not appear in the view.At time t = 5,
y > 0
and the text can no longer enter the view.Thus, I return
0n
, but the test expects5n
. Why?This comment is hidden because it contains spoiler information about the solution
Loading more items...