leetcode 【Leetcode】Palindrome Number 问题描述 Determine whether an integer is a palindrome. Do this without extra space. Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note the restriction
leetcode 【LeetCode】String to Integer (atoi) 问题描述 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
leetcode 【LeetCode】7. Reverse Integer 问题描述 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 问题分析 题目不难,稍微麻烦的是整型溢出。比如1234567899,倒过来是9987654321,但现在已经超出了整型的最大数了,所以,针对整型溢出需要做一定处理。 代码 class Solution { public: int reverse(int x) { int
leetcode 【LeetCode】5. Longest Palindromic Substring 问题描述 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 给定一个字符串S,找到最长的回文子串(
leetcode 【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
leetcode 【LeetCode】Add Two Numbers 问题描述 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return
leetcode 【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. Example: