Integer Palindrome Check

Check if the digits in a non-negtive 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.
  • 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.