Pergunta de entrevista da empresa Aristocrat

Card shuffling logic in best complexity.