Hello there.
I just started doing some learning chellanges.
Right now i’m at this challenge
I just wrote the following code, to solve one of the tasks (“Removing the root in a tree with two nodes should set the second to be the root.”)
// case 2: target has one child, change code below this line
else if (children === 1) {
if (target == this.root) {
const root = this.root
this.root = this.root.right
this.root.left = root.left
}
}
After checking it, it marked all the tasks as completed and would let me progress, even tho i didnt even implement the main task (" The remove
method should remove nodes with one child.")