Pregunta de entrevista de JLR

Asked leetcode question after clearing online test