10000 square root · Ibhrahimazzad/LeetcodeMay@1109458 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1109458

Browse files
square root
1 parent b72a987 commit 1109458

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
31A6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public:
3+
bool isPerfectSquare(int n) {
4+
for (long long int i = 1; i*i<=n; i++) {
5+
if (n%i==0&&(n/i)==i)
6+
return true;
7+
}
8+
return false;
9+
}
10+
};

0 commit comments

Comments
 (0)
0