Reverse a Number
Basic Maths DSA practice problem on Onlearn.
Difficulty: easy.
Topics: Reverse the digits of an integer N, Mathematical Algorithms, Loops, Time Complexity, Space Complexity, Big O Notation, Basic Arithmetic, mathematical operations, number manipulation, time complexity analysis, general programming, Number Manipulation.
Problem Statement Given an integer N, return the reverse of the given number. Note: If a number has trailing zeros, then its reverse will not include them. For example, the reverse of 10400 will be 401 instead of 00401. Input Specification The input will be a single integer N. Output Specification Return the reversed integer. Sample Test Cases Example 1: Input: Output: Explanation: The reverse of 12345 is 54321. Example 2: Input: Output: Explanation: The reverse of number 7789 is 9877.