Design and implement a text editor data structure that supports four progressively complex parts: Part 1 — Basic Text Buffer: Implement a data structure with: - insert(position: int, text: str) — insert text at the given character position - delete(start: int, end: int) — delete characters from start to end…