solution 1: public class Solution { public String replaceSpace(StringBuffer str) { return str.toString().replace(" ", "%20"); } }solution 2: public String replace(StringBuffer str) { int n = str.length(); for(int i=0; i<n; i++) { if(str.charAt(i) == ' '...