rewrite leetcode populating next right pointer in each node