Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
85
var assert = require('assert');
function Node(val) {
this.val = val;
this.left = this.right = null;
}
function maxValPerLevel(root) {
// Fill in this method
return root;
}
// const root = new Node(2);
// root.left = new Node(3);
// root.right = new Node(7);
// root.left.left = new Node(5);
// root.left.right = new Node(8);
// root.right.right = new Node(9);
// console.log(maxValPerLevel(root));
function Node(val) {
this.val = val;
this.left = null;
this.right = null;
}
// Regular binary trees
OUTPUT
Results will appear here.