donnemartin / interactive-coding-challenges

120+ interactive Python coding interview challenges (algorithms and data structures). Includes Anki flashcards.
Other
29.44k stars 4.45k forks source link

bst_valid_challenge's one test case is wrong #197

Open goalong opened 7 years ago

goalong commented 7 years ago

hi, I noticed that test case below is not a valid binary search tree, it might be valid if we delete the node 6, but in your challenge notebook marked it as valid. I'm not sure I should delete the node 6 and send a pr or just submit an issue, so I just submit an issue. Valid:

      5
    /   \
   5     8
  / \   /
 4   6 7
donnemartin commented 7 years ago

Hi @goalong, nice catch! Yes I think we should delete node 6 in the test cases and unit tests.

Are you interested in a PR?

goalong commented 7 years ago

Sure, I will send a PR soon.

girishkumbhar commented 4 years ago

Ok, Send PR