题目:请实现一个函数,把字符串中的每个空格替换成"%20"。例如输入"We are happy.",则输出"We%20are%20happy."。class Solution { func replace(_ s: String) -> String { guard s.count > 0 else { retur...
import Foundation class BubbleSortSolution { func sort(_ n: [Int]) -> [Int] { var nums = n for i in 0..<n.count { for j in 0..&...