Solving LCA by reducing to RMQ in C#