摘要:
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 阅读全文
摘要:
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}; 阅读全文
摘要:
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 阅读全文