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.
Me neither... Python will never ceases to surprise me. :)
That's not an issue. Your code is too slow. The 6s time limit exists to test performance.
You need to think of a better way calculate the answer.
The number
n
maybe as large as1000000000
.This comment is hidden because it contains spoiler information about the solution
Please mark all solution relevant texts as spoilers–even if you post a comment on a solution, and yes, even if you post in Chinese.
By the way, you will get more feedback if you write in English.
That being said, nice solution, although your explanation is a little bit wordy.
You return
None
if the number isn't a square. For example youris_square(3)
isNone
. But it should beFalse
. This is also reported by the tests:(The number will of course vary)