
LeetCode
Joe-Han
这个作者很懒,什么都没留下…
展开
-
【1-5】LeetCode:Python解题
1. Two Sum【Easy】Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not原创 2017-12-09 11:42:04 · 3642 阅读 · 0 评论 -
【11-15】LeetCode:Python解题
11. Container With Most Water【Medium】Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i i原创 2017-12-09 11:52:57 · 1173 阅读 · 0 评论 -
【16-20】LeetCode:Python解题
16. 3Sum Closest【Medium】Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each i原创 2017-12-09 12:00:01 · 1485 阅读 · 0 评论 -
【6-10】LeetCode:Python解题
6. ZigZag Conversion【Medium】The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P原创 2017-12-09 11:47:01 · 1220 阅读 · 0 评论 -
【21-25】LeetCode:Python解题
21. Merge Two Sorted Lists【Easy】Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Solution 1:# Defini原创 2017-12-16 11:46:14 · 1886 阅读 · 0 评论 -
【26-30】LeetCode:Python解题
26. Remove Duplicates from Sorted Array【Easy】Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for原创 2018-01-27 23:08:24 · 1988 阅读 · 0 评论 -
【35-40】LeetCode:Python解题
41. First Missing Positive【Hard】Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run ...原创 2018-03-19 17:47:09 · 1172 阅读 · 0 评论