摘要:
class Solution { public: vector<int> plusOne(vector<int>& digits) { for(int i = digits.size() - 1; i >= 0 ; i--) { if((++digits[i]) % 10 == 0) { digit 阅读全文
posted @ 2021-07-16 17:26
FL1188
阅读(23)
评论(0)
推荐(0)
摘要:
class Solution { public: int maxSubArray(vector<int>& nums) { int before_addtion = 0; int cur_addtion = 0; int max = INT_MIN; for(int i = 0; i < nums. 阅读全文
posted @ 2021-07-16 16:07
FL1188
阅读(17)
评论(0)
推荐(0)
摘要:
//给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。 //你可以假设数组中无重复元素。 class Solution { public: int searchInsert(vector<int>& nums, int targe 阅读全文
posted @ 2021-07-16 14:59
FL1188
阅读(22)
评论(0)
推荐(0)
摘要:
int binarySearch(int[] nums, int target) { int low = 0; int high = nums.length; while (low < high) { int mid = low + ((high - low) >> 1); if (target > 阅读全文
posted @ 2021-07-16 14:32
FL1188
阅读(80)
评论(0)
推荐(0)
浙公网安备 33010602011771号