IBM interview question

2 easy to easy-medium leetcode style questions