MathWorks interview question

Reverse linked list in K groups