Caseware interview question

Sort through a deck of cards using a function