solution 1: rotate linked list