PepsiCo Interview Question

Asked a leetcode easy question and OOPs concepts