摘要:
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : 阅读全文
posted @ 2021-08-18 12:34
三一一一317
阅读(61)
评论(0)
推荐(0)
摘要:
class Solution { public: int maxSubArray(vector<int>& nums) { int res = INT_MIN; int sum = 0; for(int i = 0; i < nums.size(); i++){ if(sum<=0){ sum = 阅读全文
posted @ 2021-08-18 11:53
三一一一317
阅读(43)
评论(0)
推荐(0)
摘要:
class Solution { public: void moveZeroes(vector<int>& nums) { int i = 0; int j = 0; while(j<nums.size()){ if(nums[j]!=0){ swap(nums[i],nums[j]); i++; 阅读全文
posted @ 2021-08-18 11:44
三一一一317
阅读(39)
评论(0)
推荐(0)
摘要:
class Solution { public: /* 小于10,1~9,9个数字,9位 小于100,10~99,90个数字,180位 小于1000,100~999,900个数字,2700位 */ int findNthDigit(int n) { long digit = 1; // 用来记录n属 阅读全文
posted @ 2021-08-18 11:33
三一一一317
阅读(60)
评论(0)
推荐(0)

浙公网安备 33010602011771号