摘要: LeetCode Notes_#16 3Sum CloestLeetCode Contents题目思路和解答思路解答 题目Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the s... 阅读全文
posted @ 2018-11-14 20:21 Howfar's 阅读(125) 评论(0) 推荐(0)
摘要: LeetCode Notes_#15 3SumLeetCode Contents题目思路和解答思路解答 题目Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives... 阅读全文
posted @ 2018-11-08 20:16 Howfar's 阅读(129) 评论(0) 推荐(0)
摘要: LeetCode Notes_#11 Container with Most WaterLeetCode Contents题目思路和解答思路解答需要注意的点 题目Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines... 阅读全文
posted @ 2018-11-08 16:42 Howfar's 阅读(112) 评论(0) 推荐(0)
摘要: LeetCode Notes_#58 Length of Last WordLeetCode Contents题目思路和解答思路解答 题目Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the str... 阅读全文
posted @ 2018-10-31 10:10 Howfar's 阅读(175) 评论(0) 推荐(0)
摘要: Python的四种常见数据结构比较Python list tuple set dict Contents本质上的区别语法上的比较 本质上的区别最重要的区别在于是否可变,是否有序这两个维度,可以分成4个象限,如下图比较 语法上的比较listtupledictset创建a=[element1,element2,...]a=(element1,element2,...)a={key1(不可变):v... 阅读全文
posted @ 2018-10-30 14:39 Howfar's 阅读(1617) 评论(0) 推荐(0)
摘要: LeetCode Notes_#53 Maximum SubarrayLeetCode Contents题目思路和解答思路解答需要注意的点 题目Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and retur... 阅读全文
posted @ 2018-10-30 14:33 Howfar's 阅读(118) 评论(0) 推荐(0)
摘要: LeetCode Notes_#38 Count and SayLeetCode Contents题目思路和解答题意思路解答总结 题目The count-and-say sequence is the sequence of integers with the first five terms as following:1.12.113.214.12115.1112211 is read of... 阅读全文
posted @ 2018-10-29 19:59 Howfar's 阅读(139) 评论(0) 推荐(0)
摘要: LeetCode Notes_#6 Zigzag ConversionLeetCode Contents题目思路和解答思路解答要注意的一些点参考 题目The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display th... 阅读全文
posted @ 2018-10-26 11:58 Howfar's 阅读(246) 评论(0) 推荐(0)
摘要: LeetCode Notes_#5 Longest Palindromic SubstringLeetCode Contents题目思路和解答思路解答 题目Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Examp... 阅读全文
posted @ 2018-10-25 17:35 Howfar's 阅读(194) 评论(0) 推荐(0)
摘要: LeetCode Notes_#3 Longest Substring Without Repeating CharactersLeetCode Contents题目思路和解答思路解答高票解答 题目Given a string, find the length of the longest substring without repeating characters.Example 1:Inp... 阅读全文
posted @ 2018-10-24 16:09 Howfar's 阅读(144) 评论(0) 推荐(0)