原题链接在这里:https://leetcode.com/problems/adding-spaces-to-a-string/description/ 题目: You are given a 0-indexed stringsand a 0-indexed integer arrayspacesthat describes the indices in the original string where space
Can you solve this real interview question? Adding Spaces to a String - 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 be
Return the modified string after the spaces have been added. Example 1: Input: s = “LeetcodeHelpsMeLearn”, spaces = [8,13,15] Output: “Leetcode Helps Me Learn” Explanation: The indices 8, 13, and 15 correspond to the underlined characters in “LeetcodeHelpsMeLearn”. We then place...