       return array[index]
     }
   }
-
+  
   public func observe(with observer: @escaping (Event<ObservableArrayEvent<Item>, NoError>) -> Void) -> Disposable {
     observer(.next(ObservableArrayEvent(change: .initial, source: self)))
     return subject.observe(with: observer)

        }
      }
    }

    // Backtrack to find out the diff
    var backtrack: [DiffStep<Element>] = []
    var i = xLen

            deletes.append(index)
          }
        }
        
        subject.next(ObservableArrayEvent(change: .beginBatchEditing, source: self))
        self.array = array
        subject.next(ObservableArrayEvent(change: .deletes(deletes), source: self))
        subject.next(ObservableArrayEvent(change: .inserts(inserts), source: self))
        subject.next(ObservableArrayEvent(change: .endBatchEditing, source: self))
      }
    } else {
      replace(with: array)
    }
  }
}
