I have an idea how to implement sub
array reverse with O(1), not including precalculation such as reading the input. I will have many reverse operations, and I can't use the trivial solution of O(N).
Edit: To be more clear I want to build data structure behind the
array with access layer that knows about reversing requests and inverts
…