摘要:
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 阅读全文
摘要:
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++] = 阅读全文
摘要:
/** * Note: The returned array must be malloced, assume caller calls free(). */ int* relativeSortArray(int* arr1, int arr1Size, int* arr2, int arr2Siz 阅读全文
摘要:
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 阅读全文
摘要:
struct ListNode* removeDuplicateNodes(struct ListNode* head){ int hash[20001] = {0}; struct ListNode* node = head; struct ListNode* pre = NULL; while( 阅读全文
摘要:
int removeElement(int* nums, int numsSize, int val){ int left=0; while(left < numsSize) { if (nums[left] == val && nums[numsSize-1] != val) nums[left+ 阅读全文
摘要:
struct ListNode* deleteDuplicates(struct ListNode* head){ if (!head) return NULL; head->next = deleteDuplicates(head->next); return (head->next && hea 阅读全文
摘要:
struct ListNode* removeElements(struct ListNode* head, int val){ if (head == NULL) { return NULL; } head->next = removeElements(head->next, val); retu 阅读全文
摘要:
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 阅读全文