Rust | Backtracking | Nice and Concise with Functional Style
I like the fact that a significant part of this already short (in comparison) solution is just assigning some variables for convenience and legibility (first 4 
I like the fact that a significant part of this already short (in comparison) solution is just assigning some variables for convenience and legibility (first 4 lines of `exist(...)`. Using iterators, `any()` and the `windows(2)` trick shortens down the solution quite a bit compared to a more imperative. Note that `dfs` is in essence a single expression.\n\n```\nimpl Solution {\n    fn dfs(board: &[Vec<char>], word: &[char], visited: &mut [Vec<bool>], m: usize, n: usize, len: usize, i: usize, j: usize, depth: usize) -> bool {\n        depth == len || (i < m && j < n && !visited[i][j] && word[depth] == board[i][j] && {\n            visited[i][j] = true;\n            let rez = [0, 1, 0, !0, 0]\n                .windows(2)\n                .any(|w| Self::dfs(board, word, visited, m, n, len, i.wrapping_add(w[0]), j.wrapping_add(w[1]), depth + 1));\n            visited[i][j] = false;\n            rez\n        })\n    }\n\n    pub fn exist(board: Vec<Vec<char>>, word: String) -> bool {\n        let m = board.len();\n        let n = board[0].len();\n        let word = word.chars().collect::<Vec<_>>();\n        let len = word.len();\n        let mut visited = vec![vec![false; n]; m];\n\n        (0..m).any(|i| (0..n).any(|j| Self::dfs(&board, &word, &mut visited, m, n, len, i, j, 0)))\n    }\n}\n```
['Rust']