2019年5月23日

[LeetCode] 3. Longest Substring Without Repeating Characters

摘要: Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer 阅读全文

posted @ 2019-05-23 20:41 generalsongsir 阅读(96) 评论(0) 推荐(0) 编辑

2019年5月8日

[LeetCode] 2. Add Two Nums

摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文

posted @ 2019-05-08 20:48 generalsongsir 阅读(114) 评论(0) 推荐(0) 编辑

[LeetCode] 1. Two Sum

摘要: Now begin! 这道题给了我们一个数组,还有一个目标数target,让我们找到两个数字,使其和为target,乍一看就感觉可以用暴力搜索,但是猜到OJ肯定不会允许用暴力搜索这么简单的方法,于是去试了一下,果然是Time Limit Exceeded,这个算法的时间复杂度是O(n^2)。那么只能 阅读全文

posted @ 2019-05-08 20:40 generalsongsir 阅读(97) 评论(0) 推荐(0) 编辑

导航