Swift dictionary Solution
\nclass Solution {\n    func isTransformable(_ s: String, _ t: String) -> Bool {\n        var map = [Int: [Int]]()\n        var s = Array(s).compactMap { Int(St
```\nclass Solution {\n    func isTransformable(_ s: String, _ t: String) -> Bool {\n        var map = [Int: [Int]]()\n        var s = Array(s).compactMap { Int(String($0)) }\n        var t = Array(t).compactMap { Int(String($0)) }\n        \n        for (i, j) in s.enumerated() {\n            if map[j] == nil {\n               map[j] = []\n            }\n            map[j]?.append(i)\n        }\n        \n        for (key, value) in map {\n            map[key] = Array(value.reversed())\n        }\n        \n        for i in t {\n            if map[i] == nil {\n                return false\n            }\n            \n            let current = map[i]?.removeLast() ?? Int.max\n            for j in 0..<i {\n                if let lower = map[j], (lower.last ?? Int.max) < current {\n                    return false\n                }\n            }\n        }\n        \n        return true\n    }\n}\n```
[]