60ms python solution which is easy to understand


  • -1
    H

    class Solution(object):
    def isPerfectSquare(self, num):
    """
    :type num: int
    :rtype: bool
    """
    if(num>2147395600):
    return False
    i=1
    while(i<=46341):
    if(ii==num):
    return True
    if(i
    i>num):
    return False
    i=i+1
    return False


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.