Reverse a Number

Medium
12
8.3% Acceptance

Create a function reverseDigit(uint n). This function will reverse the digits of the number n.

Example:

  • If n = 123, then reverseDigit() should return 321.
  • If n = 5342, then reverseDigit() should return 2435.

NOTE: The function should be public.