上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 63 下一页
摘要: typedef struct _Data{ int index; int val; } Data; int cmp(const void *a, const void *b){ return ((Data*)b)->val - ((Data*)a)->val; } char ** findRelat 阅读全文
posted @ 2020-09-09 19:43 温暖了寂寞 阅读(138) 评论(0) 推荐(0) 编辑
摘要: int removeDuplicates(int* nums, int numsSize){ if (!numsSize) return 0; int i,j=1; for (i=1; i<numsSize; i++) { if (nums[i] != nums[i-1]) nums[j++] = 阅读全文
posted @ 2020-09-09 18:17 温暖了寂寞 阅读(77) 评论(0) 推荐(0) 编辑
摘要: /** * Note: The returned array must be malloced, assume caller calls free(). */ int* relativeSortArray(int* arr1, int arr1Size, int* arr2, int arr2Siz 阅读全文
posted @ 2020-09-09 15:20 温暖了寂寞 阅读(140) 评论(0) 推荐(0) 编辑
摘要: char * removeDuplicates(char * S){ int top=-1; int i; int len=strlen(S); for(i=0;i<len;i++){ S[++top]=S[i];//入栈 if(top>0&&S[top]==S[top-1]){ top=top-2 阅读全文
posted @ 2020-09-09 13:44 温暖了寂寞 阅读(196) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* removeDuplicateNodes(struct ListNode* head){ int hash[20001] = {0}; struct ListNode* node = head; struct ListNode* pre = NULL; while( 阅读全文
posted @ 2020-09-09 11:37 温暖了寂寞 阅读(121) 评论(0) 推荐(0) 编辑
摘要: int removeElement(int* nums, int numsSize, int val){ int left=0; while(left < numsSize) { if (nums[left] == val && nums[numsSize-1] != val) nums[left+ 阅读全文
posted @ 2020-09-09 11:17 温暖了寂寞 阅读(118) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* deleteDuplicates(struct ListNode* head){ if (!head) return NULL; head->next = deleteDuplicates(head->next); return (head->next && hea 阅读全文
posted @ 2020-09-09 10:42 温暖了寂寞 阅读(144) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* removeElements(struct ListNode* head, int val){ if (head == NULL) { return NULL; } head->next = removeElements(head->next, val); retu 阅读全文
posted @ 2020-09-09 10:17 温暖了寂寞 阅读(102) 评论(0) 推荐(0) 编辑
摘要: char * removeOuterParentheses(char * S){ int len = strlen(S),count=1,n=0; char* ret = (char*)calloc(len,sizeof(char*)); for (int i=1; i<len; i++) { (S 阅读全文
posted @ 2020-09-09 09:00 温暖了寂寞 阅读(124) 评论(0) 推荐(0) 编辑
摘要: int removePalindromeSub(char * s){ if (!*s) return 0; int left = 0; int right = strlen(s)-1; while(left < right) { if (s[left++] != s[right--]) return 阅读全文
posted @ 2020-09-08 18:37 温暖了寂寞 阅读(157) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 63 下一页