每日力扣
craaazy
这个作者很懒,什么都没留下…
展开
-
每日一题 二分法、
class Solution {public: int removeDuplicates(vector<int>& nums) { if(nums.size()<=1) { return nums.size(); } int next=1; int sz=nums.size(); int prev=0; int cur=0; while...原创 2022-04-07 15:33:36 · 131 阅读 · 0 评论 -
每日一题 力扣1
二分法class Solution {public: int mySqrt(int x) { int l = 0, r = x, ans = -1; while (l <= r) { int mid = l + (r - l) / 2; if ((long long)mid * mid <= x) { ans = mid; l = m原创 2022-04-03 16:09:22 · 222 阅读 · 0 评论