IBM interview question

Basic dsa leetcode easy question