367. Valid Perfect Square Solution 1 (time O(1), space O(1)) class Solution(object): def isPerfectSquare(self, num): """ :type num: int :rtype: bool """ return float.is_integer(sqrt(num))