Closed underwindfall closed 2 years ago
https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/
思路
[x] 刷15mins
[x] 刷5mins
// time O(n) // space O(1) public String replaceSpace(String s) { String c = "%20"; StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == ' ') { sb.append(c); } else { sb.append(s.charAt(i)); } } return sb.toString(); }
https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/
思路
[x] 刷15mins
[x] 刷5mins