Is Perfect Square

EasyMath

Description

Given a non-negative integer n, return true if it is the square of a whole number, and false otherwise.

Examples

Input:n = 16
Output:true
Explanation:

16 is the square of a whole number.

Input:n = 14
Output:false
Explanation:

14 is not the square of a whole number.

Input:n = 0
Output:true
Explanation:

0 is the square of a whole number.

Constraints

  • 0 ≤ n ≤ 10⁹

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.