摘要:
int minSubArrayLen(int s, int* nums, int numsSize){ int i, j, sum=0, maxLen=0; int arr[50000]={0}; for (i=0; i<numsSize && maxLen!=1; i++) { sum+=nums 阅读全文
摘要:
void dfs(char** grid, int gridSize, int* gridColSize, int r, int c){ if (r < 0 || r >= gridSize || c < 0 || c >= *gridColSize || grid[r][c] != '1') re 阅读全文
摘要:
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ /** * Note: The ret 阅读全文
摘要:
typedef struct{ int hash[4]; }st; int judge(char* s,int start,st* arr,int* size,int* map){ int i, add=0; for (i=start; i<start+10; i++){ if(arr[add].h 阅读全文
摘要:
int compareVersion(char * version1, char * version2){ int i, j, start1, start2, num1, num2, len1 = strlen(version1), len2 = strlen(version2); for (i = 阅读全文
摘要:
int cmp(const void*a,const void*b){ char s1[100],s2[100]; sprintf(s1,"%d%d",*(int *)a,*(int *)b); sprintf(s2,"%d%d",*(int *)b,*(int *)a); return strcm 阅读全文
摘要:
int evalRPN(char ** tokens, int tokensSize){ int stack[5000], i, top=0; for (i=0; i<tokensSize; i++){ if ( isdigit(tokens[i][0]) || strlen(tokens[i])> 阅读全文
摘要:
int findPeakElement(int* nums, int numsSize){ int l = 0, r = numsSize - 1; while (l < r) { int mid = (l + r) / 2; if (nums[mid] > nums[mid + 1]) r = m 阅读全文
摘要:
int findMin(int* nums, int numsSize){ if (numsSize==1) return *nums; int left=0, right=numsSize-1, mid; while(left<right){ mid=(left+right)/2; if(mid> 阅读全文
摘要:
char * reverseWords(char * s){ char* stack[100]; int pst = 0, len=strlen(s); char* retStr = (char*)calloc(len+1, sizeof(char)); char* temp; temp = str 阅读全文