Just a runnable solution
Code\n\nimpl Solution {\n    pub fn earliest_and_latest(n: i32, first_player: i32, second_player: i32) -> Vec<i32> {\n        let mut mn = 10000;\n        let m
# Code\n```\nimpl Solution {\n    pub fn earliest_and_latest(n: i32, first_player: i32, second_player: i32) -> Vec<i32> {\n        let mut mn = 10000;\n        let mut mx = 0;\n\n        let mut arr = vec![0; n as usize];\n        for i in 1..=n {\n            arr[i as usize - 1] = i;\n        }\n        Solution::dfs(&arr, 1, &mut mn, &mut mx, first_player, second_player);\n        vec![mn, mx]\n    }\n\n    fn dfs(arr: &Vec<i32>, round: i32, mn: &mut i32, mx: &mut i32, first: i32, second: i32) {\n        let size = arr.len() / 2;\n        if arr.len() == 1 {\n            return;\n        }\n        for i in 0..size {\n            if arr[i] == first && arr[arr.len() - i - 1] == second {\n                *mn = (*mn).min(round);\n                *mx = (*mx).max(round);\n                return;\n            }\n        }\n        let mut f1 = false;\n        let mut f2 = false;\n        for n in arr {\n            f1 |= *n == first;\n            f2 |= *n == second;\n        }\n        if !f1 || !f2 {\n            return;\n        }\n        let mut nextarr = vec![0; size + (arr.len() % 2)];\n        let m = (1 << size) - 1;\n        for i in 0..=m {\n            let mut left = 0_i32;\n            let mut right = nextarr.len() as i32 - 1;\n            for j in 0..size {\n                if (1 << j) & i != 0 {\n                    nextarr[left as usize] = arr[j];\n                    left += 1;\n                } else {\n                    nextarr[right as usize] = arr[arr.len() - j - 1];\n                    right -= 1;\n                }\n            }\n            if arr.len() % 2 != 0 {\n                nextarr[left as usize] = arr[arr.len() / 2];\n            }\n            Solution::dfs(&nextarr, round + 1, mn, mx, first, second);\n        }\n    }\n}\n```
['Rust']