Valid Perfect Square

Problem Id: 367 Difficulty: Easy


Intuition

Solution


class Solution:
    def isPerfectSquare(self, num: int) -> bool:
        i = 1
        while i * i < num:
            i += 1
        # print(i)
        return i * i == num