Leetcode 367. Valid Perfect Square

class Solution(object):
    def isPerfectSquare(self, num):
        """
        :type num: int
        :rtype: bool
        """
        for x in range(1000000):
            if x*x==num:
                return True
        return False
        

 

posted @ 2019-03-19 07:21  周洋  阅读(94)  评论(0编辑  收藏  举报