Infosys Interview Question

Dta structure and algorithms question