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.
probably. because the output should be an array of two numerical values, so
"abcd"
is completely unexpected for the tests. GIGO.am i the only one facing issues with the test case while i return something random like "abcd" and it gives an error , too many values to unpack
Please don't post solutions (even non-working ones) in the discourse. If you post code, please use the
spoiler
flag.This comment is hidden because it contains spoiler information about the solution
Having an unreachable return statement is a general problem; if used with recursion it just means you will not only get erroneous
None
return values, but also the occasional Stack Overflow. In your code: what happens when the recursion stack unwinds back to the original calling function and exits theif
statement. What follows it? Nothing. ErgoNone
.I don't know what inputs you're using locally. It's up to you to follow what path your code takes step by step for any given input. We can't do your debugging for you :)
well , isnt this problem about recursive functions ? also why does it work on repl but not here
Please don't post solutions/code in the discourse without the
spoiler
flag.You have a
return
statement nested inside anif/else
clause. This is a code smell. What if theif
clause is always true, when does your code ever returnans
? In Python, a function that doesn't have an explicit return value (or, in your case, an unreachable return statement) returnsNone
by default.This comment is hidden because it contains spoiler information about the solution
ive tried my best and i dont see any other way to improve this
I can't tell the solution here. But think if you can first reduce the range. That would be the first optimization. And then see if you're seeing some mathematical pattern.
and how to do that?
Yes and by a lot
Yes.
Read Darren1182003's post below.
why .title() isnt working?
Loading more items...