def balance(self):
        l1 = len(self.min_h)
        l2 = len(self.max_h)
        if l1 - l2 > 1:
            heapq.heappush(self.max_h, -heapq.heappop(self.min_h))
            self.balance()
        elif l2 - l1 > 1:
            heapq.heappush(self.min_h, -heapq.heappop(self.max_h))
            self.balance()
        return
dataset/ETHPy150Open algorhythms/HackerRankAlgorithms/Find Median.py/DualHeap.balance/original