![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
明明是我先的
talk is cheap,show me the code
展开
-
leetcode 2. Add Two Numbers
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 contain a single digit. Add the two numbers and return i...原创 2018-06-21 14:13:36 · 110 阅读 · 0 评论 -
leetcode 354. 俄罗斯套娃信封问题
给定一些标记了宽度和高度的信封,宽度和高度以整数对形式 (w, h) 出现。当另一个信封的宽度和高度都比这个信封大的时候,这个信封就可以放进另一个信封里,如同俄罗斯套娃一样。请计算最多能有多少个信封能组成一组“俄罗斯套娃”信封(即可以把一个信封放到另一个信封里面)。示例:输入: envelopes = [[5,4],[6,4],[6,7],[2,3]]输出: 3 解释: 最多信封的...原创 2018-06-22 09:35:14 · 1638 阅读 · 0 评论 -
leetcode 18. 四数之和
给定一个包含 n 个整数的数组 nums 和一个目标值 target,判断 nums 中是否存在四个元素 a,b,c 和 d ,使得 a + b + c + d 的值与 target 相等?找出所有满足条件且不重复的四元组。注意:答案中不可以包含重复的四元组。示例:给定数组 nums = [1, 0, -1, 0, -2, 2],和 target = 0。满足要求的四元组集合为...原创 2018-06-22 09:34:31 · 298 阅读 · 0 评论 -
leetcode 365. 水壶问题
有两个容量分别为 x升 和 y升 的水壶以及无限多的水。请判断能否通过使用这两个水壶,从而可以得到恰好 z升 的水?如果可以,最后请用以上水壶中的一或两个来盛放取得的 z升 水。你允许:装满任意一个水壶清空任意一个水壶从一个水壶向另外一个水壶倒水,直到装满或者倒空示例1: 输入: x = 3, y = 5, z = 4输出: True示例2:输入: x = ...原创 2018-06-22 09:33:44 · 1823 阅读 · 0 评论 -
URL中的#号的作用
一、#的意思/作用 #代表网页中的一个位置。类似于PPT里面的页内超链接。#右面的字符,就是该位置的标识符(即 这个位置的标记)。比如,http://www.XXX.com/index.html#location就代表www.xxx.com这个网站index.html这个网页的location位置。我想这个例子应该很清楚了。浏览器读取这个URL后,会自动将‘location’位置滚动至可视区...原创 2018-06-22 09:32:01 · 1479 阅读 · 0 评论 -
leetcode 72. Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:...原创 2018-06-21 14:19:25 · 124 阅读 · 0 评论 -
leetcode 65. Valid Number
Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem原创 2018-06-21 14:19:06 · 140 阅读 · 0 评论 -
leetcode 62. Unique Paths
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bo...原创 2018-06-21 14:18:32 · 134 阅读 · 0 评论 -
leetcode 61. Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.Example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL.#...原创 2018-06-21 14:18:06 · 130 阅读 · 0 评论 -
leetcode 55. Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo...原创 2018-06-21 14:17:47 · 114 阅读 · 0 评论 -
leetcode 16. 3Sum Closest
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 input would have exactly...原创 2018-06-21 14:17:22 · 108 阅读 · 0 评论 -
leetcode 15. 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain dup...原创 2018-06-21 14:17:03 · 96 阅读 · 0 评论 -
leetcode 4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3]...原创 2018-06-21 14:16:45 · 101 阅读 · 0 评论 -
leetcode 3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with...原创 2018-06-21 14:14:52 · 122 阅读 · 0 评论 -
leetcode 300. 最长递增子序列
给定一个无序的整数数组,找到其中最长递增子序列的长度。示例:输入: [10,9,2,5,3,7,101,18]输出: 4 解释: 最长的递增子序列是 [2,3,7,101],它的长度是 4。from bisect import bisect_leftclass Solution(object): def lengthOfLIS(self, nums): ...原创 2018-06-22 09:35:29 · 1113 阅读 · 0 评论