We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b261ee0 commit c3827dbCopy full SHA for c3827db
rearrange_array_linear.js
@@ -0,0 +1,9 @@
1
+const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
2
+let result = []
3
+
4
+for (let i = 0; i < arr.length / 2; i++) {
5
+ result.push(arr[arr.length - i - 1])
6
+ result.push(arr[i])
7
+}
8
9
+console.log(result)
0 commit comments