Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Valid Perfect Square
Bookmark
Linear Search
Binary Search
Newton's Method
Input
Perfect square (16)
Not perfect square (14)
Perfect square (1)
Large perfect square (49)
Custom
num
=
16
num = 16
i
1
num = 16
i
1
num = 16
i
1
num = 16
i
1
1 × 1 = 1
1 <= 16 → still in range
num = 16
i
2
1 × 1 = 1
1 <= 16 → still in range
num = 16
i
2
2 × 2 = 4
4 <= 16 → still in range
num = 16
i
3
2 × 2 = 4
4 <= 16 → still in range
num = 16
i
3
3 × 3 = 9
9 <= 16 → still in range
num = 16
i
4
3 × 3 = 9
9 <= 16 → still in range
num = 16
i
4
4 × 4 = 16
16 <= 16 → still in range
num = 16
i
4
4 × 4 = 16
16 == 16 ✓
algo
master
.
io
Step:
Start: check if 16 is a perfect square
0 / 9
Input
Perfect square (16)
Not perfect square (14)
Perfect square (1)
Large perfect square (49)
Custom
num
=
16
0 / 9
algo
master
.
io
Step:
Start: check if 16 is a perfect square