import java.util.*;
public class Solution {
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
*
* @param s string字符串
* @return string字符串
*/
public String replaceSpace (String s) {
// write code here
int N = s.length();
char[] arr = new char[3 * N];
int size = N;
for(int i = 0, j = 0; i < N; i++) {
char c = s.charAt(i);
if(c != ' ') {
arr[j++] = c;
} else {
arr[j++] = '%';
arr[j++] = '2';
arr[j++] = '0';
size += 2;
}
}
return new String(arr, 0, size);
}
}