Ad
Code
Diff
  • class MissingInteger:
        def __init__(self, sequence):
            self.sequence = sequence
            self.perfect_sequence = range(min(self.sequence), max(self.sequence) +1 )
    
        def solution(self):
            for number in self.perfect_sequence:
                if number not in self.sequence:
                    return number
    • class MissingInteger:
    • def __init__(self, arr):
    • self.arr = arr
    • self.temp = [i for i in range(min(self.arr), max(self.arr) + 1)]
    • def __init__(self, sequence):
    • self.sequence = sequence
    • self.perfect_sequence = range(min(self.sequence), max(self.sequence) +1 )
    • def solution(self):
    • for x, y in zip(self.arr, self.temp):
    • if x != y:
    • return y
    • return None
    • for number in self.perfect_sequence:
    • if number not in self.sequence:
    • return number