Ad
Code
Diff
  • class MyInt:
        def __init__(self, value):
            self.value = value
            
        def subtract(self, another_int):
            self.value = self.value - another_int.value
    
    def sub(a: int, b: int) -> int:
        int_a, int_b = MyInt(a), MyInt(b)
        int_a.subtract(int_b)
        return int_a.value
    • from operator import sub
    • class MyInt:
    • def __init__(self, value):
    • self.value = value
    • def subtract(self, another_int):
    • self.value = self.value - another_int.value
    • def sub(a: int, b: int) -> int:
    • int_a, int_b = MyInt(a), MyInt(b)
    • int_a.subtract(int_b)
    • return int_a.value