Treebo Hotels Interview Question

stack and dynamic programming related problems