Are you generating all possible numbers and then checking each one to see if the digits are increasing or not?
I did that first, and it works for a low number of digits, but takes expoentially longer with larger numbers of digits.
There's a better way of approaching the problem.
No, they mean that doing nothing but returning an empty list will time out. Which I've observed as well :/
Are you generating all possible numbers and then checking each one to see if the digits are increasing or not?
I did that first, and it works for a low number of digits, but takes expoentially longer with larger numbers of digits.
There's a better way of approaching the problem.
For Python 2.7:
The code:
return []
Output:
Passed: 17 Failed: 75 Exit Code: 1
STDERR
Execution Timed Out (12000 ms)
It Kata is impossible.
Try again, it should be fixed now.
C translation kumited
This is wrong kata. My solution on Python3 passes 92-189 tests.
Code:
def solution (a):
return 3
get "STDERR: Execution Timed Out (12000 ms)"
My solution on Python 2 passes 209 tests and get "STDERR: Execution Timed Out (12000 ms)"