Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 862 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 862 Bytes

Integer Palindrome Check

Check if the digits in a non-negative integer form a palindrome.

Exercise

  • Design and implement a method that checks if the digits in the input positive integer forms a palindrome. The method returns true if the digits in the input form a palindrome. The method returns false otherwise.
  • For example,
    • 12521 and 4554 are palindromes.
    • 326725 is not a palindrome.
  • Share and explain the time and space complexities for your solution in the comments above the method implementation.
    • If you describe the complexity in terms of n, be sure to explain what n stands for.
  • If you think of multiple approaches to solve the problem, implement the solution which minimizes space complexity. Explain the other approaches, and your decision in comments above the code.

Note: Do not use Ruby provided functions.