|Write a program to reverse an array without using ...|General Coding Problems

fn reverse_array(arr: &mut [i32])

Medium

Write a program to reverse an array without using extra space.

fn reverse_array(arr: &mut [i32])

Asked in

infosys

Examples

Example 1:
Input: [1,2,3,4,5]
Output: [5,4,3,2,1]
Example 2:
Input: [10,20,30]
Output: [30,20,10]
Submit Result

Click Run to test sample cases, or Submit to evaluate all cases