Closed MuhammadTausif closed 2 hours ago
class Solution:
def reverseArray(self, arr):
n=len(arr)
l=0
r=n-1
while (l<=r):
arr[l],arr[r]=arr[r],arr[l]
l+=1
r-=1
return arr
Reverse an Array
Link
Difficulty: Easy
You are given an array of integers arr[]. Your task is to reverse the given array.
Examples:
Constraints: