摘要:
int numDecodings(char * s){ int f0 = 0, f1=1, f2, i, len = strlen(s); for (i = len - 1; i >= 0; i--){ if (s[i] == '0') f2 = 0; else if (s[i] == '1' || 阅读全文
摘要:
int* grayCode(int n, int* returnSize){ int cnt=pow(2,n); *returnSize=cnt; int* arr=(int*)calloc(cnt,sizeof(int)); int i, j, temp; int hash[10000]={0}; 阅读全文
摘要:
struct ListNode* partition(struct ListNode* head, int x){ struct ListNode* left=(struct ListNode*)calloc(sizeof(struct ListNode),1); struct ListNode* 阅读全文
摘要:
struct ListNode* deleteDuplicates(struct ListNode* head){ int cnt=0; struct ListNode* root=(struct ListNode*)calloc(sizeof(struct ListNode),1); struct 阅读全文
摘要:
bool search(int* nums, int numsSize, int target){ if(numsSize==0) return false; int i; if(nums[0]==target) return true; else if(nums[0]>target){ for(i 阅读全文