Skip to content

jagaad/reverse-integer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 

Repository files navigation

Reverse Integer Challenge ๐Ÿ”„

Introduction ๐Ÿš€

Welcome to the Reverse Integer Challenge! This coding problem, inspired by a LeetCode problem, is a common interview question and a great exercise to test your problem-solving and coding skills. The goal is simple: given a 32-bit signed integer, reverse the digits of that integer.

Problem Statement ๐Ÿ“

Objective ๐ŸŽฏ

Write a function that takes an integer as its input and returns the integer with its digits reversed. More details can be found on the LeetCode problem page.

Constraints ๐Ÿ›‘

  • The input is a 32-bit signed integer. Your function should maintain the sign of the integer.
  • If the reversed integer overflows (i.e., it's outside the range of a 32-bit signed integer), return 0.

Examples ๐Ÿ’ก

  1. Input: 123 Output: 321

  2. Input: -123 Output: -321

  3. Input: 120 Output: 21

  4. Input: 0 Output: 0

  5. Input: 2147533648 Output: 0 (outside 32 bit integer)

  6. Input: -2147383643 Output: 0 (outside 32 bit integer)

Requirements โœ…

  • The solution should be written in Programming Language of the Interiew.
  • Your function should handle edge cases gracefully and efficiently.
  • Unit tests are encouraged to verify the correctness of your solution. (optional)

Submission Guidelines ๐Ÿ“ฎ

You can use online coding sandboxes like Replit, CodeSandbox, StackBlitz, or JSFiddle for coding and sharing your solution. Just make sure to provide the link to your code in the submission.

Otherwsie use steps bellow to submit it:

  • Fork this repository and create a new branch for your solution.
  • Add your solution file to the repository. Please name the file in the following format: <GitHub_Username>_reverse_integer.[ext].
  • Ensure your code is well-documented and follows the coding standards for the language you're using.
  • Create a pull request against the main branch of this repository with your solution, or share the link to your solution.
  • In your pull request or shared link, provide a brief explanation of your approach and any assumptions you made while solving the problem.

Evaluation Criteria ๐Ÿ‘€

Your submission will be evaluated based on:

  • Correctness: Correctly reverse the digits of the input integer while handling edge cases and overflow? โœ…
  • Code Quality: Is the code readable, well-structured, and maintainable? ๐Ÿ“Š
  • Efficiency: Does the solution perform well with large inputs? ๐Ÿš€
  • Testing: Are there unit tests, and do they adequately cover different scenarios? ๐Ÿงช (optional)

Good luck, and we look forward to seeing your solution! ๐ŸŒŸ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published