diff --git a/python/sprint5_final/B/code.py b/python/sprint5_final/B/code.py index aa1f2ab4..aabed655 100644 --- a/python/sprint5_final/B/code.py +++ b/python/sprint5_final/B/code.py @@ -1,20 +1,19 @@ -# ! change LOCAL to False before submitting ! -# set LOCAL to True for local testing - from typing import Optional -LOCAL = True -if LOCAL: - class Node: - def __init__(self, left=None, right=None, value=0): - self.right = right - self.left = left - self.value = value -def remove(root, key) -> Optional[Node]: +# ! Do not change Node class ! +class Node: + def __init__(self, left=None, right=None, value=0): + self.right = right + self.left = left + self.value = value + + +def remove(root, key) -> Optional["Node"]: # Your code # “ヽ(´▽`)ノ” - pass + ... + def test(): node1 = Node(None, None, 2) @@ -24,10 +23,11 @@ def test(): node5 = Node(node4, None, 8) node6 = Node(node5, None, 10) node7 = Node(node3, node6, 5) - newHead = remove(node7, 10) - assert newHead.value == 5 - assert newHead.right is node5 - assert newHead.right.value == 8 + new_head = remove(node7, 10) + assert new_head.value == 5 + assert new_head.right is node5 + assert new_head.right.value == 8 + if __name__ == '__main__': - test() \ No newline at end of file + test()