![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 71
普通网友
这个作者很懒,什么都没留下…
展开
-
leetcode中AddTwoNumbers
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-03-08 10:07:12 · 216 阅读 · 0 评论 -
leetcode中RemoveNthNodeFromEndofList
Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the li...原创 2018-06-10 16:47:47 · 218 阅读 · 0 评论 -
leetcode中LetterCombinationsofaPhoneNumber
class Solution: def letterCombinations(self, digits): """ :type digits: str :rtype: List[str] """ number_string={} number_string[2]=['a','b','c'] ...原创 2018-06-10 15:22:46 · 267 阅读 · 0 评论 -
leetcode中3sum
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 the sum of zero.Note:The solution set must not contain ...原创 2018-06-06 10:37:58 · 147 阅读 · 0 评论 -
leetcode中isPalindrome
判断一个整数是否是回文数。不能使用辅助空间。点击查看提示一些提示:负整数可以是回文数吗?(例如 -1)如果你打算把整数转为字符串,请注意不允许使用辅助空间的限制。你也可以考虑将数字颠倒。但是如果你已经解决了 “颠倒整数” 问题的话,就会注意到颠倒整数时可能会发生溢出。你怎么来解决这个问题呢?本题有一种比较通用的解决方式。提示:负整数不可以是回文数。python不存在颠倒整数溢出的问题。解决方法如下...原创 2018-03-28 10:12:56 · 1919 阅读 · 0 评论 -
leetcode中ZigZagConversion
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 A H NA P L S I I G...原创 2018-03-27 10:45:42 · 216 阅读 · 0 评论 -
leetcode中StringtoInteger
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases....原创 2018-03-22 10:29:02 · 233 阅读 · 1 评论 -
leetcode中ReverseInteger
Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dealing with an envi...原创 2018-03-21 11:06:57 · 165 阅读 · 0 评论 -
leetcode中ContainerWithMostWater
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 is at (i, ai) and (i, 0). Find two ...原创 2018-03-24 14:52:02 · 132 阅读 · 0 评论 -
leetcode中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 the l...原创 2018-03-14 14:03:25 · 115 阅读 · 0 评论 -
leetcode中LongestPalindromicSubstring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a valid answer. Example:I...原创 2018-03-20 15:13:17 · 163 阅读 · 0 评论 -
leetcode中MedianofTwoSortedArrays
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]nums2...原创 2018-03-20 15:07:25 · 150 阅读 · 0 评论 -
leetcode中Two_sum
题目如下: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 use the sa...原创 2018-03-12 10:37:45 · 159 阅读 · 0 评论 -
Leetcode中ValidParentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of b...原创 2018-09-05 16:33:54 · 97 阅读 · 0 评论