I initially wrote a recursive function for this problem, and it worked for small numbers. However, the test cases included large numbers, which caused too many recursive calls, exceeding Python’s recursion depth limit and resulting in an error. To fix this, I switched to an iterative approach using a for loop, which avoids recursion limits and runs efficiently for large inputs.
Lol :-) Yeah, feeling more confident but haven't solved this kata. Didn't try and looking at it now I still have no clue what to do. Should I import something? Should I download it from somewhere? Just rethorical questions :-) Not going to spend much time on it...
Scheisse, I might've forgotten to remove the print in the loop... xDDD
too late now I guess
Troubleshooting Your Solution - I get Max Buffer Size Reached (1.5 MiB)
Max Buffer Size Reached (1.5 MiB) reached with python when using a simple array on random tests
Cleared test cases without problem
I initially wrote a recursive function for this problem, and it worked for small numbers. However, the test cases included large numbers, which caused too many recursive calls, exceeding Python’s recursion depth limit and resulting in an error. To fix this, I switched to an iterative approach using a for loop, which avoids recursion limits and runs efficiently for large inputs.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
can you explain me that how did you come up with this? what's the thought process behind it?
A solution that needs space proportional to the input numbers' values won't be able to handle the random tests.
Lol :-) Yeah, feeling more confident but haven't solved this kata. Didn't try and looking at it now I still have no clue what to do. Should I import something? Should I download it from somewhere? Just rethorical questions :-) Not going to spend much time on it...
How is your progress? Are you feeling now more confident? 3 years have passed
Fix: https://www.codewars.com/kumite/67a748fc21023fa4a16bc44f?sel=67a748fc21023fa4a16bc44f
As I said, it looks like the indices are wrong.
The tests expect:
On the leaderboard I see:
... so I had to return
n-2
th warrior, 0-based, to complete this.I don't get it, I'm suring beauty soup, and always retrieve the wrong user
Enabled in this fork
Loading more items...