Problem Statement | |||||||||||||
You want to type a document containing only spaces and new lines.
Let SP and NL denote a space character and a new line character, respectively.
You are given a int[] lines describing the desired document.
The elements of lines represent the number of SP characters in each line,
in order.
Each line must end with a NL character.
In other words, the document should look like this:
lines[0] SP characters, followed by a NL,
followed by lines[1] SP characters, followed by a NL,
..., lines[N-1] SP characters, followed by a NL
(where N is the number of elements in lines).
The editor has a cursor, which can be positioned between two adjacent characters or at the beginning or end of the document. You can move this cursor freely. The editor has three special keys:
| |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | lines will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of lines will be between 0 and 1,000,000, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|