Rust O(n) HashMap
\nuse std::collections::HashMap;\n\nimpl Solution {\n    pub fn can_form_array(arr: Vec<i32>, pieces: Vec<Vec<i32>>) -> bool {\n        let mut pieces_map: Hash
```\nuse std::collections::HashMap;\n\nimpl Solution {\n    pub fn can_form_array(arr: Vec<i32>, pieces: Vec<Vec<i32>>) -> bool {\n        let mut pieces_map: HashMap<i32, &Vec<i32>> = HashMap::new();\n        for piece_arr in &pieces {\n            pieces_map.insert(piece_arr[0], piece_arr);\n        }\n        \n        let mut i = 0;\n        while i < arr.len() {\n            match pieces_map.get(&arr[i]) {\n                Some(piece_arr) => {\n                    let mut piece_len = piece_arr.len();\n                    if i + piece_len > arr.len() || &arr[i..i + piece_len] != &piece_arr[..] {\n                        return false;\n                    }\n                    i += piece_arr.len();\n                }\n                None => {\n                    return false;\n                }\n            }\n        }\n        \n        return true;\n    }\n}\n```
[]