Leetcode刷题 - 7. Reverse Integer [easy]
0x00 问题描述
Given a 32-bit signed integer, reverse digits of an integer.
已知输入是一个32位的整数,将其进行十进制倒序
Example:
Input: 123
Output: 321
Input: -123
Output: -321
Input: 120
Output: 21
Given a 32-bit signed integer, reverse digits of an integer.
已知输入是一个32位的整数,将其进行十进制倒序
Input: 123
Output: 321
Input: -123
Output: -321
Input: 120
Output: 21
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 same element twice.
假设只有一种答案的可能且每个数字只能使用一次,既不能重复相加。
Given nums = [2, 7, 11, 15], target = 9,
Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].