Solution to Populating Next Right Pointers