Sollicitatievraag bij Josh Software

How to reverse a array

Antwoord op sollicitatievraag

Anoniem

23 aug 2024

think of python one can use :- a = [1,2,3,4,5] n = len(a) left = 0 right = n-1 while left < right: a[left], a[right] = a[right], a[left] left += 1 right -= 1 print(a)