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.
I spend awhile on this only to realize there was an incredibly simple solution bangs head on keyboard
Got it. Thank you!
Instead of creating a string, think about what math you can do to get the position. Try small ranges first, and you'll get the idea.
For digits
1
to10
, you can just returnn - 1
, since those are all single digits displaced by one, right?So, how would you calculate it for numbers in the double digit range?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm not sure about that error, Nintama. Could you post your code with a spoiler?
I've passed all the tests, but I keep getting error.
Traceback (most recent call last):
File "main.py", line 79, in
result = champernowneDigit(input)
File "/home/codewarrior/solution.py", line 6, in champernowneDigit
raise ValueError("Invalid inputs!")
ValueError: Invalid inputs.
I'm quite new to programming, so can someone tell me what the issue is? Thanks. (I'm using Python by the way)