rewrite leetcode list cycle i ii