Design a text editor with a cursor. The text is lower-case letters; the cursor starts at the beginning of an empty text and can sit at either end or between any two characters.
addText(text) - insert text at the cursor. The cursor ends after the inserted textdeleteText(k) - delete up to k characters to the left of the cursor. Return how many were actually deletedcursorLeft(k) - move the cursor left by up to k characters. Return the last (up to) 10 characters to the left of the cursorcursorRight(k) - move the cursor right by up to k characters. Return the last (up to) 10 characters to the left of the cursor- No operation may cost time that depends on the total length of the text: only on the length added,
k, and 10