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 | 536 Views, 17297 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 | 536 Views, 17297 Search Bots | 70 Words Subscribe to Feed Burner

Related Articles

  1. Algorithm Interview: Shifted String
  2. Reverse a Linked List
  3. Daily Interview Problem: Count Number of Unival Subtrees
  4. Find Pythagorean Triplets
  5. Daily Interview Puzzle: Minimum Size Subarray Sum
  6. Longest Substring Without Repeating Characters
  7. New Vulnerabilities (CVE-2016-4581) have been detected in CentOS/RHEL/CloudLinux 7
  8. Algorithm Interview: Smallest Number that is not a Sum of a Subset of List
  9. PHP Unit Tests on VPS Server
  10. Floor and Ceiling of a Binary Search Tree

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />