Rust translated, 4ms 100%
rust\nimpl Solution {\n    pub fn is_transformable(s: String, t: String) -> bool {\n        let mut idx = vec![vec![]; 10];\n        let mut pos = vec![0; 10];\
```rust\nimpl Solution {\n    pub fn is_transformable(s: String, t: String) -> bool {\n        let mut idx = vec![vec![]; 10];\n        let mut pos = vec![0; 10];\n        for i in 0..s.len() {\n            idx[(s.as_bytes()[i] - b\'0\') as usize].push(i as i32);\n        }\n        for i in 0..t.len() {\n            let d = (t.as_bytes()[i] - b\'0\') as usize;\n            if pos[d] >= idx[d].len() {\n                return false;\n            }\n            for j in 0..d {\n                if pos[j] < idx[j].len() && idx[j][pos[j]] < idx[d][pos[d]] {\n                    return false;\n                }\n            }\n            pos[d] += 1;\n        }\n        return true;\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_is_transformable() {\n        assert_eq!(\n            Solution::is_transformable("84532".to_string(), "34852".to_string()),\n            true\n        );\n    }\n\n    #[test]\n    fn test_is_transformable_02() {\n        assert_eq!(\n            Solution::is_transformable("34521".to_string(), "23415".to_string()),\n            true\n        );\n    }\n\n    #[test]\n    fn test_is_transformable_03() {\n        assert_eq!(\n            Solution::is_transformable("12345".to_string(), "12435".to_string()),\n            false\n        );\n    }\n\n    #[test]\n    fn test_is_transformable_04() {\n        assert_eq!(\n            Solution::is_transformable("1".to_string(), "2".to_string()),\n            false\n        );\n    }\n}\n```
[]