Ad
  • Custom User Avatar

    most elegant solution

  • Custom User Avatar

    I don't think this is either a clever or best practice to find out square number, because it is very
    inefficient for large numbers.
    In my computer, it toke 31 seconds to run your code and isSquare 100000000 and find out it is a square number.
    But if you use bisector method (like my answer), it will take less than a second.