摘要: bool increasingTriplet(int* nums, int numsSize){ int max=nums[0], min=nums[0], i, cnt=1; for(i=1; i<numsSize && cnt<3; i++){ if(nums[i]>max){ cnt++; m 阅读全文
posted @ 2021-01-24 12:08 温暖了寂寞 阅读(78) 评论(0) 推荐(0) 编辑
摘要: struct st { int pre; int prepre; }; #define max(a,b) ((a)>(b))?(a):(b) struct st recursion(struct TreeNode* root){ if(!root){ return (struct st){0,0}; 阅读全文
posted @ 2021-01-24 11:51 温暖了寂寞 阅读(52) 评论(0) 推荐(0) 编辑
摘要: void wiggleSort(int* nums, int numsSize){ int hash[5001]={0}, i, j=0; for(i=0; i<numsSize; i++) hash[nums[i]]++; i=(numsSize%2)?numsSize-1 :numsSize-2 阅读全文
posted @ 2021-01-24 11:33 温暖了寂寞 阅读(52) 评论(0) 推荐(0) 编辑