Implemented solution for CodeEval's Reverse Groups challenge
https://www.codeeval.com/open_challenges/71/