ABC interview question

Question related to data structures