IoTium interview question

Usual leet code code question from medium to hard level