← Back to all problems
Easy

Valid Perfect Square

Updated Feb 24, 2026

Problem

Return true if num is a perfect square.

Constraints

1 <= num <= 2^31 - 1

Examples

Example 1

Input: {"num": 16}
Output: true

Function Signature

def isPerfectSquare(self, num: int) -> bool

How to Submit

Implement a Solution class with a isPerfectSquare method.

Your method will be called with the input parameters and should return the answer.