K44

Valid Perfect Square

Junior Level Candidate
Target Time: 15 - 20 Minutes
Type: BOOLEAN

Problem Statement & Objective

Given a positive integer num, return True if num is a perfect square or False otherwise without using library functions.

Function Signature (Python)

is_perfect_square(num: int) -> bool

Input & Output Contract

Output Rule:True veya False.

System Constraints

1 <= num <= 2^31 - 1

Example Execution Walkthrough

num = 16 -> 4 * 4 = 16 -> True
num = 14 -> tam karekökü yok -> False

Example Test Scenarios (3)

Example 1: 16 (4^2)
Input:[16]
Expected Output:true
Example 2: 14
Input:[14]
Expected Output:false
Example 3: 1 (1^2)
Input:[1]
Expected Output:true
Loading Python Editor...
Input Parameters
[
  16
]
Expected Output
true