Pregunta de entrevista de Wipro

Consecutive stone pile merge problem