To the Top
File:  root - text - article - 2019 - 12 - reverse-integer.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 474 Views, 15792 Search Bots | 70 Words

Subscribe to Feed Burner | Browse | Archive
Hi, here's your problem today. This problem was recently asked by LinkedIn:

Write a function that reverses the digits a 32-bit signed integer, x. Assume that the environment can only store integers within the 32-bit signed integer range, [-2^31, 2^31 - 1]. The function returns 0 when the reversed integer overflows.

Example:
Input: 123
Output: 321


class Solution:
def reverse(self, x):
# Fill this in.

print(Solution().reverse(123))
# 321
print(Solution().reverse(2**31))
# 0
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 474 Views, 15792 Search Bots | 70 Words Subscribe to Feed Burner

Related Articles

  1. Daily Interview Problem: Get all Values at a Certain Height in a Binary Tree
  2. Daily Interview Problem: Count Number of Unival Subtrees
  3. Find Pythagorean Triplets
  4. Daily Interview Problem: Trapping Rainwater
  5. Skip the readings, focus on problems. And use all the hints!
  6. Staying on a Chess Board
  7. First and Last Indices of an Element in a Sorted Array
  8. Maximum In A Stack
  9. Fibonacci coding
  10. Daily Interview Problem: Full Binary Tree

Comments (0)

Your Email (Domain Part Not Exposed):

Your Comments:

Privately By Mail Colors More Smileys S x y @

Verification (Click Image 2 Refresh):

    Be the first one to comment this page !


Page Edited: October 30 2020 14:21:09 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />