How to reverse the order of elements in an array between indices $i$ and $j$.

Ex: For the array `[A,B,C,D,E,F]`, calling the function `reverse(array, 1,4)` will modify the array to be `[A,E,D,C,B,F]`.

I want to optimize the solution to work with multiple calls on the same array, so pre-computations allowed. What would be the most efficient way to do so?