替换空格 (Java 实现)时间复杂度O(n) public String replaceSpace1(StringBuffer str) { if (str == null) { return null; } String s = str.toString(); int current = 0; int total = s.length(); String result = ""; List<String> strings = Arrays.asList(s.split(" ")); for (int...