leetcode
Dismate
这个作者很懒,什么都没留下…
展开
-
二:Leetcode 第二题
用的是队列,并不是自己写的,惭愧 c版和c++版 struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) { struct ListNode*head=(struct ListNode*)malloc(sizeof(struct ListNode)), *tail = head; ...原创 2018-10-12 00:37:12 · 223 阅读 · 0 评论 -
三:Leetcode 第三题
c版 int lengthOfLongestSubstring(char* s) { int n = strlen(s); int indexes[128] = {0}; int max = 0; int len; for (int i = 0, j = 0; j < n; j++) { if (indexes[s[j]] >...原创 2018-10-12 00:55:57 · 408 阅读 · 0 评论 -
一:Leetcode 第一题
从现在开始刷了,非ACM参赛者,大三,非计算机专业 1、C语言版 /** * Note: The returned array must be malloced, assume caller calls free(). */ #include <stdio.h> #include <stdlib.h> int* twoSum(int* nums, int num...原创 2018-10-08 12:51:29 · 165 阅读 · 0 评论