You are viewing a single comment's thread. Return to all comments →
function reverseArray(a: number[]): number[] { const n = a.length; for(let i = 0; i < n / 2; i++) { const temp = a[i]; a[i] = a[n - 1 - i]; a[n - 1 - i] = temp; } return a; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays - DS
You are viewing a single comment's thread. Return to all comments →