- 博客(6)
- 收藏
- 关注
原创 从零开始的leetcode刷题——第2题
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) { s...
2019-04-18 17:03:03 168
原创 从零开始的leetcode刷题——第5题
int check(int front,int rear,int size,char* s){ if( front-rear+1 <= size ) return 0; while ( rear<=front ){ if( s[rear] != s[front] ) break; rear++; ...
2019-04-18 16:59:54 149
原创 从零开始的leetcode刷题——第6题
char* convert(char* s, int numRows) { int len=strlen(s); int *num; int i=0,j=1,k=0; char *p; int temp=0; if(numRows==1) return s; num=(int*)malloc(len*sizeof(int...
2019-04-18 16:58:38 166
原创 从零开始的leetcode刷题——第4题
double findMedianSortedArrays(int* nums1, int nums1Size, int* nums2, int nums2Size) { int flag1,flag2;//标记两个数组 int temp1,temp2;//用于存放中位数 int i; double sum=0;//如果是偶数,sum为中位数的二倍,如果是奇数,s...
2019-04-09 22:20:18 157
原创 从零开始的leetcode刷题——第9题
48ms 6.8MB 待改进 bool isPalindrome(int x) { if(x<0) return 0; int p[10]; int count=0; int i; p[count]=x%10; x=(x-x%10)/10; if(x==0) return 1; while (x){ ...
2019-04-02 20:58:52 106
原创 从零开始的leetcode刷题——第3题
------------------------------------------------------------------2019.04.01 测试没有问题,提交出现堆栈溢出的第三题。 在自己IDE上测试没有问题,不明白为什么? int lengthOfLongestSubstring(char* s) { char *source; int s_size,lon...
2019-04-01 21:28:09 210
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人