Ad
  • Default User Avatar

    You are correct - the solution for {19, 9, 10, 4', 5, 4, 6, 3, 2'', 1, 4, 1, 3, 2, 4} IS 8,1.
    This is one of the example test cases (test.assert_equals(find_incorrect_value([19, 9, 10, 4, 5, 4, 6, 3, 2, 1, 4, 1, 3, 2, 4]),(8,1), "Second node on leaf level should be 1")). So I'm not sure exactly what your question is - I think you understand what is going on!

  • Custom User Avatar

    'This is because of the condition "if the incorrect value occurs on the leaf level, then the right child will always be the incorrect one." Since 9 + 1 != 16, the 1 must be changed to 7, rather than changing the 9 to 15.'