Help me in solving SNTEMPLE problem

My issue

I am not able to understand this problem solution. Why they are taking minimum of l[i] and r[i] and then taking maximum

Learning course: Jump from 2* to 3*
Problem Link: A temple of Snakes Practice Problem in Jump from 2* to 3* - CodeChef