摘要: 代码: class Solution { public: bool isPerfectSquare(int num) { long long a = (long long)num; long long left = 0; long long right = a; while (left <= rig 阅读全文
posted @ 2023-05-13 18:10 创造一个有琳的世界 阅读(10) 评论(0) 推荐(0)
摘要: 代码: class Solution { public: int mySqrt(int x) { long long a = (long long)x; long long left = 0; long long right = a; while (left <= right) { long lon 阅读全文
posted @ 2023-05-13 17:44 创造一个有琳的世界 阅读(14) 评论(0) 推荐(0)
摘要: 代码: class Solution { public: vector<int> searchRange(vector<int>& nums, int target) { int left = 0; int right = nums.size() - 1; int beginPos = 0, end 阅读全文
posted @ 2023-05-13 15:08 创造一个有琳的世界 阅读(16) 评论(0) 推荐(0)
摘要: 按照代码随想录的顺序,今天刷了LeetCode 35.搜索插入位置,也是刷的力扣第一题 class Solution { public: int searchInsert(vector<int>& nums, int target) { int left = 0; int right = nums. 阅读全文
posted @ 2023-05-12 22:12 创造一个有琳的世界 阅读(11) 评论(0) 推荐(0)