JLR interview question

Asked leetcode question after clearing online test