IBM interview question

Two leetcode problems for the online Assessments