Tag: LeetCode: 7 Reverse Integer

  • LeetCode: 7 Reverse Integer

    Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-2³¹, 2³¹ – 1], then return 0. 给定一个有符号的 32 位整数 x,返回将 x 的数字部分反转后的结果。如果反转后的整数超出了 32 位有符号整数的范围 [-2³¹, 2³¹ – 1],则返回 0。 Example Input: x = 123 Output: 321 Input:…