Skip to content

Commit fdd48f6

Browse files
authored
Create smart_num.py
1 parent a6a0f23 commit fdd48f6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

smart_num.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://www.hackerrank.com/challenges/smart-number/problem
2+
3+
import math
4+
5+
def is_smart_number(num):
6+
val = int(math.sqrt(num))
7+
if num / (val*val) == 1:
8+
return True
9+
return False
10+
11+
for _ in range(int(input())):
12+
num = int(input())
13+
ans = is_smart_number(num)
14+
if ans:
15+
print("YES")
16+
else:
17+
print("NO")

0 commit comments

Comments
 (0)