Motorq interview question

The questions were from graphs and dp and difficult monotonic stack implementation