Refactor solution to 'reverse nodes in k-group'