Flyhomes interview question

Stack based DSA questions with moderate difficulty