@annnnnyjj I changed "ListNode fast = head" to "ListNode fast = head.next" and it works and passes all the tests. Since leetcode only accepts the answer that takes [(n+1)/2]th list node as root. For example, when input is [1, 2], it only accepts output [1, null, 2] rather than [2, 1], even though they are both balanced BST. I think this should be clarified in problem description.
Convert Sorted List to Binary Search Tree