You are given a s and a spaces that contains the indices in the original string where spaces should be added.
Each space should be inserted immediately before the character located at the corresponding index in s.
Return the modified string after inserting all the spaces.
Constraints:
s.length
s consists only of lowercase and uppercase English letters.
spaces.length
spaces[i] s.length
All the values of spaces are strictly increasing.
You are given a s and a spaces that contains the indices in the original string where spaces should be added.
Each space should be inserted immediately before the character located at the corresponding index in s.
Return the modified string after inserting all the spaces.
Constraints:
s.length
s consists only of lowercase and uppercase English letters.
spaces.length
spaces[i] s.length
All the values of spaces are strictly increasing.