Problem 2315. Reverse the input
Given an input (n), produce an output in the reverse order with out using string variables or string function.
Example
x = [123] y = [321]
NOTE: This is not x = [1, 2, 3]
This should work for all inputs.
Example
x = [ 96721] y = 12769
Solution Stats
Problem Comments
-
7 Comments
You need to put correct test cases, not a function that implements one solution for the problem. ;-)
I fixed the test cases.
Nice!! but maybe you put 5 or 6 cases, so it is not easy to cheat... ;-)
Thank you for your comments, this was my first problem to post.
the function name of this problem is conflict with system function 'reverse', so can't be executed.
Reverse is now a command on Matlab. Kindly change the name of the function here @Joseph Pauwels
The function name has been updated. The problem should now be solvable.
Solution Comments
Show commentsProblem Recent Solvers88
Suggested Problems
-
2506 Solvers
-
Extract leading non-zero digit
2072 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2049 Solvers
-
Back to basics 22 - Rotate a matrix
887 Solvers
-
Sum of odd numbers in a matrix
550 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!