摘要:
char findTheDifference(char * s, char * t){ int i,val=0; for (i=0; t[i] != '\0'; i++){ if (s[i]) val ^= s[i]; val ^= t[i]; } return val; } 阅读全文
摘要:
int findTheDistanceValue(int* arr1, int arr1Size, int* arr2, int arr2Size, int d){ int count=0,i,j; for (i=0; i<arr1Size; i++){ for (j=0; j<arr2Size; 阅读全文
摘要:
int findJudge(int N, int** trust, int trustSize, int* trustColSize){ int total=(N+1)*N/2,i; int hash[1001]={0}; for (i=0; i<trustSize; i++) { hash[tru 阅读全文
摘要:
int firstBadVersion(int n) { int mid,left=1,right=n; while(left<right){ mid = left + (right-left)/2; if (isBadVersion(mid)) right = mid; else left=mid 阅读全文
摘要:
int firstUniqChar(char * s){ int hash[128]={0},i,len=strlen(s); for (i=0; i<len; i++) hash[s[i]]++; for (i=0; i<len; i++) if (hash[s[i]] == 1) return 阅读全文
摘要:
char ** fizzBuzz(int n, int* returnSize){ char** arr = (char**)calloc(n+1,sizeof(char*)); // const char* s35 = "FizzBuzz"; // const char* s3 = "Fizz"; 阅读全文
摘要:
int** flipAndInvertImage(int** A, int ASize, int* AColSize, int* returnSize, int** returnColumnSizes){ *returnSize=ASize; *returnColumnSizes=AColSize; 阅读全文
摘要:
//深度优先 void dfs(int** image,int row,int col,int x,int y,int start,int newColor){ if (x<0 || x>=row || y<0 || y>=col || image[x][y] != start) return; i 阅读全文
摘要:
int cmp(const void* a, const void* b){ return (*(int**)a)[0] > (*(int**)b)[0]; } int* gardenNoAdj(int N, int** paths, int pathsSize, int* pathsColSize 阅读全文