Infinity Pillars interview question

1 coding challange to be done