Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Start traversing from the leaf. Always go up till you reach the root.
Change pointers as asked, make the current node's parent its left child, and make the left child the right one if needed.