Rust solution
Code\n\nimpl Solution {\n    pub fn reverse_str(s: String, k: i32) -> String {\n        let k = k as usize;\n        let mut s = s.chars().collect::<Vec<_>>();\
# Code\n```\nimpl Solution {\n    pub fn reverse_str(s: String, k: i32) -> String {\n        let k = k as usize;\n        let mut s = s.chars().collect::<Vec<_>>();\n        for start in (0..s.len()).step_by(2 * k) {\n            let mut i = start;\n            let mut j = (start + k - 1).min(s.len() - 1);\n            while i < j {\n                s.swap(i, j);\n                i += 1;\n                j -= 1;\n            }\n        }\n        s.into_iter().collect()\n    }\n}\n```
['Rust']