Solution that meets requirements and uses the hint


  • 0
    H

    Is there actually any solution to this problem that uses the hint "binary tree" that actually meets the requirements of
    Runtime: O(n)
    and
    Memory: O(1)
    ?

    Yes I know the XOR solution works, but has nothing to do with the hint.


  • 0
    H

    actually never mind, it looks like the "hint" next to the custom test case section ALWAYS says "binary tree" no matter what the problem is. So I suppose its not really a hint now is it.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.