IBM iX interview question

To solve a Leetcode question