why i am not able to pass second test case even if my code is correct.
Not passing a testcase
https://ide.codingblocks.com/s/219431
you were building the tree wrong, ur logic was almost correct, flaws fixed with comments in the code mentioned here
however, there was also some minor issue on hacker blocks, which failed ur code, do not worry however, such problems are a rarity, this code uses the same logic but just gets submitted, submit this one otherwise ur logic was almost correct (just minor flaws) which are fixed in this code
1 Like