Myntra interview question

Problem solving question based on DSA