#2. 移除字符串指定索引字符
移除字符串指定索引字符
Remove Character at Index N
Background
This problem tests basic string manipulation.
Problem Description
Given a non-empty string and an integer , return a new string where the character at index has been removed. The value of will be a valid index of a character in the original string (i.e., will be in the range to str.length()-1 inclusive).
Input Format
Input is given from standard input in the following format.
s n
Output Format
Output is printed to standard output in the following format.
result_s
Sample
kitten"
1
ktten"
kitten"
0
itten"
kitten"
4
kittn"
Sample Explanation
In the first sample, the string is kitten". After removing the character 'i' at index , we get ktten".
In the second sample, the string is kitten". After removing the character 'k' at index , we get itten".
In the third sample, the string is kitten". After removing the character 'e' at index , we get kittn".
Constraints
Time limit: second, Memory limit: KiB for each test case.