import Foundation func evaluateExpression(_ expression: String) -> Int { // 替换所有括号为小括号 var exp = expression .replacingOccurrences(of: "[", with: "(") .replacingOccurrences(of: "]", with: ")") .replacingOccurrences(of: "{", with: "(") .re...