- 博客(10)
- 收藏
- 关注
转载 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 218
转载 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 210
转载 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 186
转载 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 149
转载 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 129
转载 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 272
转载 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 132
转载 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 108
转载 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 101
转载 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 147
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人