79763433

Date: 2025-09-12 23:38:03
Score: 1
Natty:
Report link

Been barely technical, when you "reverse" something, it is always relative to a reference point. I your code example, the reference point (pivot) is the middle of the array, so you can think like your algorithm is doing a 180° flip over the central point of the array.

But this is not the only way to "reverse" a list/array/tuple, this is just a very efficient way to do it. But you can choose to use you first item as your reference point; in that scenario your algorithm will need to iterate the full array and depending on your implementation, maybe doing something more, but essentially, you will need every item to be repositioning to index * -1

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Alejandro Guajardo