text and a strictly increasing list of indices marks (0-based). Insert a single space before every character whose index appears in marks.
The indices refer to the original string, not to the string after insertions. Return the resulting string.text='GoodMorningWorld', marks=[4, 11] → 'Good Morning World'
The character at index 4 is M and the one at index 11 is W; the spaces go right before them.
text='abc', marks=[0, 2] → ' ab c'
A space before index 0 lands at the very start of the string.
text='Hello', marks=[] → 'Hello'
No marks, so the string stays as it is.
text consists of lowercase and uppercase English lettersmarks is strictly increasingtext='GoodMorningWorld', marks=[4, 11]
'Good Morning World'
Run checks the first 3 tests in your browser. Submit checks all 78 tests on the server, hidden ones included.