Just a runnable solution
Code\n\nimpl Solution {\n    pub fn longest_awesome(s: String) -> i32 {\n        use std::collections::HashMap;\n        let mut map: HashMap<i32, i32> = HashMa
# Code\n```\nimpl Solution {\n    pub fn longest_awesome(s: String) -> i32 {\n        use std::collections::HashMap;\n        let mut map: HashMap<i32, i32> = HashMap::new();\n        let mut mask = 0;\n        let mut ans = 0;\n        map.insert(0, -1);\n        for (i, c) in s.bytes().enumerate() {\n            mask ^= 1 << (c - b\'0\');\n            if let Some(&j) = map.get(&mask) {\n                ans = ans.max(i as i32 - j);\n            }\n            for k in 0..10 {\n                let mask2 = mask ^ (1 << k);\n                if let Some(&j) = map.get(&mask2) {\n                    ans = ans.max(i as i32 - j);\n                }\n            }\n            map.entry(mask).or_insert(i as i32);\n        }\n        ans\n    }\n}\n```
['Rust']