master
Matthew Huntington 3 years ago
parent dcda81a325
commit 64fa180f6e

@ -77,7 +77,12 @@ const getLeaves = (node)=>{
if(threePathResult.length === 0){ if(threePathResult.length === 0){
return twoPathResult; return twoPathResult;
} else { } else {
return [twoPathResult, threePathResult] if(Number.isInteger(twoPathResult[0])){
return [twoPathResult, threePathResult]
} else {
twoPathResult.push(threePathResult)
return twoPathResult;
}
} }
} }
const leaves = getLeaves(tree); const leaves = getLeaves(tree);

Loading…
Cancel
Save