Microsoft Interview Question

reverse list with K groups