Google interview question

DSA question with mL GenAI