Implement Range minimum query