Company: Microsoft_12july
Difficulty: medium
Text Editor Problem Description Implement a prototype for a text editor application with the following functionalities: ["Insert", s] : Insert the string s at the current cursor position. The cursor will also move to the right by the length of the inserted string. ["Print", x] : If the cursor is at position m , print all the characters from m - x to m + x . ["Left", x] : Move the cursor x positions to the left. ["Right", x] : Move the cursor x positions to the right. ["Backspace", x] : Remove x characters to the left of the cursor. ["Delete", x] : Remove x characters to the right of the cursor. Given a 2-D array of strings size n x 2 , commands , find the string obtained on each of the print operations starting from an empty string and cursor at the starting position and report them as an array of printed strings in order. If for any operation the cursor reaches the beginning or the end of the current string, it does not go any further on the either side. Note: For consistency, the sec