• + 1 comment

    it will be overwritten at the next level up, so you set it to null then you go up and set it to the previous node...which is why I think recursion for this problem is not really efficient since you only need to set the next pointer of the original head node to null.