I tried solving Problem D during Practice using the method described in tutorial. But I keep getting runtime error. Is there a way to determine which runtime error my code is encountering or probably what's wrong with my solution? Here is a link to my submission.
You need to check bounds of vector when you compare threads[left][lpos] and threads[right][rpos] with threads[i][0]