BeadOrnaments solution. Doesn't pass the submit tests, I disagree with
their method.
https://www.hackerrank.com/challenges/beadornaments/forum/questions/7462