Christopher SuAbout Projects Contact More

Problem

Given an array of numbers where each element is the number of cards in a stack, find the number of moves until Bulgarian solitaire reaches a stable configuration. For the rules of Bulgarian solitaire, see its Wikipedia page.