IsPerfectSquare(n) questions

前端 未结 0 1103
清歌不尽
清歌不尽 2021-02-01 23:54

this is my code and whatever below it is my test scenarios, it keeps failing at -16 what should i do?

def isPerfectSquare(n):
     return abs(n)**(1.0/2)%1 == 0

         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题