PepsiCo interview question

Asked a leetcode easy question and OOPs concepts