Overly complicated custom iterator solution
Code\n\nimpl Solution {\n    pub fn ambiguous_coordinates(s: String) -> Vec<String> {\n        let mut ans = vec![];\n        let s = &s[1..s.len() - 1];\n     
# Code\n```\nimpl Solution {\n    pub fn ambiguous_coordinates(s: String) -> Vec<String> {\n        let mut ans = vec![];\n        let s = &s[1..s.len() - 1];\n        for i in 1..s.len() {\n            let (left, right) = s.split_at(i);\n            let left: SeperatorIterator = left.into();\n            let right: SeperatorIterator = right.into();\n            for (l, r) in left.flat_map(|l| right.clone().map(move |r| (l.clone(), r))) {\n                ans.push(format!("({l}, {r})"));\n            }\n        }\n        ans\n    }\n}\n\n#[derive(Clone, Debug)]\nenum SeperatorIterator<\'a> {\n    ZeroStart(Option<String>),\n    ZeroEnd(Option<String>),\n    Regular(SeperatorCounter<\'a>),\n    Invalid,\n}\n\nimpl<\'a> From<&\'a str> for SeperatorIterator<\'a> {\n    fn from(s: &\'a str) -> Self {\n        if s.len() == 1 {\n            return Self::Regular(SeperatorCounter::new(s));\n        }\n        let b = s.as_bytes();\n        if b[0] == b\'0\' {\n            if *b.last().unwrap() != b\'0\' {\n                let mut res = String::with_capacity(s.len() + 1);\n                res.push(s.chars().next().unwrap());\n                res.push(\'.\');\n                res.extend(s.chars().skip(1));\n                return Self::ZeroStart(Some(res));\n            } else {\n                return Self::Invalid;\n            }\n        }\n        if *b.last().unwrap() == b\'0\' {\n            return Self::ZeroEnd(Some(s.to_owned()));\n        }\n        Self::Regular(SeperatorCounter::new(s))\n    }\n}\n\nimpl<\'a> Iterator for SeperatorIterator<\'a> {\n    type Item = String;\n\n    fn next(&mut self) -> Option<String> {\n        match self {\n            Self::ZeroStart(s) => s.take(),\n            Self::ZeroEnd(s) => s.take(),\n            Self::Regular(x) => x.next(),\n            Self::Invalid => None\n        }\n    }\n}\n\n#[derive(Clone, Debug)]\nstruct SeperatorCounter<\'a> {\n    s: &\'a str,\n    index: usize,\n}\n\nimpl<\'a> SeperatorCounter<\'a> {\n    fn new(s: &\'a str) -> Self {\n        Self {\n            s,\n            index: 0,\n        }\n    }\n}\n\nimpl<\'a> Iterator for SeperatorCounter<\'a> {\n    type Item = String;\n\n    fn next(&mut self) -> Option<String> {\n        if self.index == 0 {\n            self.index += 1;\n            return Some(self.s.to_owned());\n        }\n        if self.index >= self.s.len() {\n            return None;\n        }\n        let (left, right) = self.s.split_at(self.index);\n        let mut res = String::with_capacity(self.s.len() + 1);\n        res.push_str(left);\n        res.push(\'.\');\n        res.push_str(right);\n        self.index += 1;\n        Some(res)\n    }\n}\n\n```
['Rust']