You are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. Each space should be inserted before the character at the given index.
For example, given s = "EnjoyYourCoffee" and spaces = [5, 9], we place spaces before 'Y' and 'C', which are at indices 5 and 9 respectively. Thus, we obtain "Enjoy Your Coffee".
Return the modified string after the spaces have been added.
1 <= s.length <= 3 * 10^5s consists only of lowercase and uppercase English letters.1 <= spaces.length <= 3 * 10^50 <= spaces[i] <= s.length - 1spaces are strictly increasing.s = "LeetcodeHelpsMeLearn", spaces = [8,13,15]"Leetcode Helps Me Learn"s = "icodeinpython", spaces = [1,5,7,9]"i code in py thon"s = "spacing", spaces = [0,1,2,3,4,5,6]" s p a c i n g"