[Rust]: Iterator approach for 2-pointer
Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\nrust []\nimpl Solution {\n    pub fn can_change(start: String, target: String) -> b
# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```rust []\nimpl Solution {\n    pub fn can_change(start: String, target: String) -> bool {\n        #[derive(Debug, Clone, Copy)]\n        enum Dir {\n            Left,\n            Right,\n        }\n\n        fn tokens(s: String) -> impl Iterator<Item = (usize, Dir)> {\n            s.into_bytes()\n                .into_iter()\n                .enumerate()\n                .filter_map(|(i, byte)| match byte {\n                    b\'L\' => Some((i, Dir::Left)),\n                    b\'R\' => Some((i, Dir::Right)),\n                    _ => None,\n                })\n        }\n\n        let mut start_tokens = tokens(start);\n        let mut target_tokens = tokens(target);\n\n        loop {\n            match (start_tokens.next(), target_tokens.next()) {\n                (Some((i, Dir::Left)), Some((j, Dir::Left))) if i >= j => {}\n                (Some((i, Dir::Right)), Some((j, Dir::Right))) if i <= j => {}\n                (None, None) => break true,\n                _ => break false,\n            }\n        }\n    }\n}\n```
['Two Pointers', 'Iterator', 'Rust']