EPIJudge
EPIJudge copied to clipboard
Minor: Change method signature in accordance with test
There is a test that strictly enforce the return to be None, but the signature requires the method to return always a BinaryTreeNode.
Since you're already making use of typing
I wanted to highlight that you could use Optional that exactly covers this use case, imho.
Optional[X] is equivalent to Union[X, None].
Hi @Bhudjo ,
It looks good to me, and I just wondering that why our solution is OK with this but your solution is having issue.
why our solution is OK with this but your solution is having issue.
Since the signature was -> BinaryTreeNode:
and my background is not Python, I returned a BinaryTreeNode
even thought it was an empty one.
Like return BinaryTreeNode()
or something similar.
When I saw the test failing and understanding that for null case wanted null response, I realized that I made this mistake because the signature was wrong, as far as I understood it.
@abuggin Hi there, sorry for the long wait. I'll check this out right after I do my state exams at the end of June. I'll keep you updated :)