IBM interview question

Moderately difficult coding questions of the leetcode type