Flowcode interview question

Rotate a linked list and sort base on node weights.