Ad
  • Default User Avatar

    Me neither... Python will never ceases to surprise me. :)

  • Custom User Avatar
  • Custom User Avatar

    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 as 1000000000.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    You return None if the number isn't a square. For example your is_square(3) is None. But it should be False. This is also reported by the tests:

    should work for random numbers
      Your solution was incorrect on 1845030339: None should equal False
    

    (The number will of course vary)