Problems given via CoderByte: TreeNode Constructor problem (1st part of the question) and validating the Binary Tree (2nd part of the question). SumMultiplier problem (check to see if 2 of the largest integers in the list, when multiplied, are larger than double the sum of the list)
Anonymous
1st question, just run a hash for both the parent and child node respectively. then check the entries to see if a parent has more than two children, and if there are duplicate node values in the tree (every node value must be unique). 2nd question is easy, just sum the entire list and multiply by two, then sort the list and grab the two highest values (done easily in python with -1 and -2 indexes which can account for list sizes of 2 or more). multiply those values and check to see if it is larger than the sum*2 target
Check out your Company Bowl for anonymous work chats.