Problem
Two DOM trees rootA and rootB have identical structure. Given a target element inside rootA, return the element at the same position inside rootB.
function findCorrespondingNode(rootA, rootB, target) {
// your code
}
Asked at Swiggy
Frontend Machine Coding interview practice: Given two containers with identical structure and a target node in the first, find the node at the same position in the…
Two DOM trees rootA and rootB have identical structure. Given a target element inside rootA, return the element at the same position inside rootB.
function findCorrespondingNode(rootA, rootB, target) {
// your code
}
Unlock the in-browser editor, test cases, and model solution with Mentoxis Premium.
Unlock with Premium