AC solution (RMQ/Sparse Table)

Range Minimum Query. Sparse Table.