Populating Next Right Pointers in Each Node II submission problem typescript

'''
let myHash = new Map<number,Node>();
function connect(root: Node | null): Node | null {
if(root){helper(root,0);}
return root;
};
function helper(current: Node | null, depth: number): Node | null {
if(myHash[depth]){
current.next = myHash[depth];
myHash[depth] = current;
}else{
myHash[depth] = current;
}
if(current.right){helper(current.right,depth + 1);}
if(current.left){helper(current.left,depth + 1);}
return null;
};
'''

I wrote this code for https://leetcode.com/explore/challenge/card/december-leetcoding-challenge/569/week-1-december-1st-december-7th/3556/ in typescript and when i use "run code" it says my output matches the input with In : [0] Out [0,#] Expected [0,#] but when i do "submit code" and it runs the same test it says it fails with In : [0] Out [0] Expected [0,#]

Comments (1)