Last Lesson in the Chain
A lesson chain is represented as an index array `next_idx`: the lesson at index i points to the next lesson `next_idx[i]`, where -1 marks the end of the chain. Given `next_idx` and a starting index `start`, return the index of the LAST lesson reached before the chain ends. The chain is guaranteed to
A lesson chain is represented as an index array `next_idx`: the lesson at index i points to the next lesson `next_idx[i]`, where -1 marks the end of the chain. Given `next_idx` and a starting index `start`, return the index of the LAST lesson reached before the chain ends. The chain is guaranteed to