You are given a String cards, which represents a sequence of cards. Shuffle the cards by repeatedly performing the specified exchange operation. The exchange operation is specified by the ints first and last, which are both 1-based indices in the sequence. Take all the cards between the first-th card and the last-th card, inclusive, and move them to the beginning of the sequence. Do not change the relative order of the moved cards. For example, if first = 2 and last = 4, an exchange operation on "ABCDEFG" would produce "BCDAEFG".
Perform the specified exchange operation times times on the given sequence and return a String containing the resulting sequence. |