Pregunta de entrevista de Daydream

2 straghtforward DSA problems: How to shuffle cards in a certain way. A candy problem.