
LeetCode
julia7_
keep coding
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
11. 盛最多水的容器[Medium]
给定 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点(i,ai) 。在坐标内画 n 条垂直线,垂直线 i的两个端点分别为(i,ai) 和 (i, 0)。找出其中的两条线,使得它们与x轴共同构成的容器可以容纳最多的水。说明:你不能倾斜容器,且n的值至少为 2。图中垂直线代表输入数组 [1,8,6,2,5,4,8,3,7]。在此情况下,容器能够容纳水(...转载 2020-02-09 19:16:55 · 262 阅读 · 0 评论 -
8. String to Integer (atoi) [Medium] 字符串转换整数
Implementatoiwhichconverts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from thi...转载 2020-02-09 12:20:51 · 249 阅读 · 0 评论 -
20. Valid Parentheses [Easy] 有效的括号
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...转载 2020-02-09 11:30:11 · 232 阅读 · 0 评论 -
6. ZigZag Conversion [Medium] Z字形变换
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)将一个给定字符串根据给定的行数,以从上往下、从左到右...转载 2020-02-08 14:10:20 · 192 阅读 · 0 评论 -
14. Longest Common Prefix [Easy] 最长公共前缀
Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string"".编写一个函数来查找字符串数组中的最长公共前缀。如果不存在公共前缀,返回空字符串""。Example...转载 2020-02-08 12:22:30 · 161 阅读 · 0 评论 -
13. Roman to Integer [Easy] 罗马数字转整数
Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM.罗马数字包含以下七种字符:I,V,X,L,C,D和M。Symbol ValueI 1V 5X 10L ...转载 2020-02-07 20:39:29 · 340 阅读 · 0 评论 -
5. Longest Palindromic Substring [Medium] 最长回文子串(Manacher不懂)
Given a strings, find the longest palindromic substring ins. You may assume that the maximum length ofsis 1000.给定一个字符串s,找到s中最长的回文子串。你可以假设s的最大长度为 1000。Example 1:Input: "babad"Output: "...转载 2020-02-07 18:48:18 · 163 阅读 · 0 评论 -
9. Palindrome Number [Easy] 回文数
Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。Example 1:Input: 121Output: true...转载 2020-02-06 12:50:34 · 137 阅读 · 0 评论 -
7. Reverse Integer [Easy] 整数反转
Given a 32-bit signed integer, reverse digits of an integer.给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 12...转载 2020-02-05 12:32:14 · 129 阅读 · 0 评论 -
3. Longest Substring Without Repeating Characters [Medium](难)
Given a string, find the length of thelongest substringwithout repeating characters.给定一个字符串,请你找出其中不含有重复字符的最长子串的长度。Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", wi...转载 2020-02-05 11:41:15 · 183 阅读 · 0 评论 -
2. Add Two Numbers [Medium]
You are given twonon-emptylinked lists representing two non-negative integers. The digits are stored inreverse orderand each of their nodes contain a single digit. Add the two numbers and return i...转载 2020-01-30 20:26:19 · 178 阅读 · 0 评论 -
1. Two Sum [Easy]
Given an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would haveexactlyone solution, and you may not use thesame...转载 2020-01-30 13:28:16 · 166 阅读 · 0 评论