BigBinary interview question

It was a leetcode problem