They asked me to, in Javascript, reverse an array of 100 numbers.
.....
They responded, “Sorting. Bubblesort, Quicksort, all sorts of stuff like that.”
Heck, sorting would only work (if you’ve described the problem correctly) if the array was originally sorted. If it was randomly-arranged items a sort wouldn’t reverse it.
Heck, sorting would only work (if you’ve described the problem correctly) if the array was originally sorted. If it was randomly-arranged items a sort wouldn’t reverse it.Yeah. I forget the actual things they said people tried to solve it with, but every one of them was inordinately complex.
Mine was simple and super elegant.