feat: 2025-10-28打卡

This commit is contained in:
wu xiangkai
2025-10-28 15:52:13 +08:00
parent fc82d7eb10
commit 2fa03ec244
13 changed files with 486 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
/*
* @lc app=leetcode id=367 lang=java
*
* [367] Valid Perfect Square
*/
// @lc code=start
class Solution {
public boolean isPerfectSquare(int num) {
long i = 0, j = num, m;
while(i <= j) {
m = i + (j-i)/2;
if(m * m == num) {
return true;
} else if(m * m <num) {
i = m + 1;
} else {
j = m - 1;
}
}
return false;
}
}
// @lc code=end