- 博客(5)
- 收藏
- 关注
原创 leetcode 5. 最长回文子串
void check(char *s,int len,int l,int r,int* start,int* maxlen){ while(l>-1&&r<len&&s[l]==s[r]) l--,r++; int len0=r-l-1; if(len0>*maxlen){ *maxlen=len0; ...
2018-04-14 22:45:18 88
原创 leetcode 4. 两个排序数组的中位数
double findMedianSortedArrays(int* nums1, int nums1Size, int* nums2, int nums2Size) { double* nums3; int c=nums1Size+nums2Size; nums3=(double*)malloc(sizeof(double)*(nums1Size+nums2Size+1)...
2018-04-13 00:03:06 205
原创 leetcode 3. 无重复字符的最长子串
int lengthOfLongestSubstring(char* s) { int len=0; char *end=s,*temp; char *addressTable[128]={NULL}; while(*end){ temp=addressTable[*end]; addressTable[*end]=end;//add...
2018-04-12 22:27:27 108
原创 leetcode 2. 两数相加
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) { ...
2018-04-12 22:17:47 162
原创 leetcode 1.两数之和
/** * Note: The returned array must be malloced, assume caller calls free(). */ int* twoSum(int* nums, int numsSize, int target) { int i,j; int *p; p=(int*)malloc(sizeof(int)*2); for...
2018-04-12 22:14:11 94
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人