Rust iterators
Intuition\n- sort both vecs\n- get all combinations of indices to skip\n- zip nums1 without 2 elements and nums2\n- check if diff of zipped numbers is equal for
# Intuition\n- sort both vecs\n- get all combinations of indices to skip\n- zip nums1 without 2 elements and nums2\n- check if diff of zipped numbers is equal for all entries in the iterator\n- get the last diff from the iterator since they are sorted in descending order because both nums1 and nums2 are sorted\n\n# Code\n```\nuse std::ops::ControlFlow;\n\nimpl Solution {\n    pub fn minimum_added_integer(mut nums1: Vec<i32>, mut nums2: Vec<i32>) -> i32 {\n        nums1.sort();\n        nums2.sort();\n        nums1\n            .iter()\n            .enumerate()\n            .flat_map(|(i, _)| {\n                nums1\n                    .iter()\n                    .enumerate()\n                    .skip(i + 1)\n                    .map(move |(j, _)| (i, j))\n            })\n            .filter_map(|(i, j)| {\n                match nums1\n                    .iter()\n                    .rev()\n                    .enumerate()\n                    .filter(|(k, _)| *k != i && *k != j)\n                    .map(|(_, x)| x)\n                    .zip(nums2.iter().rev())\n                    .map(|(x, y)| y - x)\n                    .try_fold(None, |prev, curr| match (prev, curr) {\n                        (Some(x), y) if x == y => ControlFlow::Continue(Some(y)),\n                        (None, y) => ControlFlow::Continue(Some(y)),\n                        _ => ControlFlow::Break(()),\n                    }) {\n                    ControlFlow::Continue(Some(x)) => Some(x),\n                    _ => None,\n                }\n            })\n            .next_back()\n            .unwrap()\n    }\n}\n```
['Rust']