- 博客(9)
- 收藏
- 关注
翻译 [Leetcode刷题] 第9题 Palindrome Number 回文数
题目:Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: false...
2020-05-03 09:15:17
185
翻译 [Leetcode刷题] 第8题 String to Integer (atoi) 字符串转换整数 (atoi)
题目:请你来实现一个atoi函数,使其能将字符串转换成整数。首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止。接下来的转化规则如下:如果第一个非空字符为正或者负号时,则将该符号与之后面尽可能多的连续数字字符组合起来,形成一个有符号整数。 假如第一个非空字符是数字,则直接将其与之后连续的数字字符组合起来,形成一个整数。 该字符串在有效的整数部分之后也...
2020-05-03 09:11:49
190
翻译 [Leetcode刷题] 第7题 Reverse Integer 整数反转
题目:Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21解题思路:假设我们正在处理一个只能...
2020-05-03 09:04:53
238
翻译 [Leetcode刷题] 第6题 ZigZag Conversion 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)P A H NA P L ...
2020-05-03 09:00:25
172
翻译 [Leetcode刷题] 第5题 Longest Palindromic Substring 最长回文子串
题目:Given a strings, find the longest palindromic substring ins. You may assume that the maximum length ofsis 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer....
2020-05-03 08:55:26
174
翻译 [Leetcode刷题] 第4题 Median of Two Sorted Arrays 寻找两个有序数组的中位数
题目:There are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assumenums1an...
2020-05-03 08:49:30
248
翻译 [Leetcode刷题] 第3题 Longest Substring Without Repeating Characters 无重复字符的最长子串
题目:Given a string, find the length of thelongest substringwithout repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example ...
2020-05-03 08:39:17
257
翻译 [Leetcode刷题] 第2题 Add Two Numbers 两数相加
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-05-03 08:31:35
222
翻译 [Leetcode刷题] 第1题 Two Sum 求两数之和
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-05-03 08:25:42
202
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人