Question: Using javascript You are given an implementation of a function solution that, given a positive integer N, prints to standard output another integer, which was
Using javascript
You are given an implementation of a function solution that, given a positive integer N, prints to standard output another integer, which was formed by reversing a decimal representation of N. The leading zeros of the resulting integer should not be printed by the function. Examples: 1. Given N=54321, the function should print 12345 . 2. Given N=10011, the function should print 11001. 3. Given N=1, the function should print 1. The attached code is still incorrect for some inputs. Despite the error(s), the code may produce a correct answer for the example test cases. The goal of the exercise is to find and fix the bug(s) in the implementation. You can modify at most three lines. Assume that: - N is an integer within the range [1..1,000,000,000]. Copyright 2009-2023 by Codility Limited. All Rights Reserved. Unauthorized copying, publication or disclosure prohibited
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
