From 5af87fb76fa9ea08299f2e876a80d326a142f2e4 Mon Sep 17 00:00:00 2001 From: daviddoji Date: Fri, 8 May 2026 16:57:58 +0200 Subject: [PATCH] Movido a src/Rust --- 001.rs | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 001.rs diff --git a/001.rs b/001.rs deleted file mode 100644 index 493d369..0000000 --- a/001.rs +++ /dev/null @@ -1,19 +0,0 @@ -fn same_to_next(lst: &[i32]) -> Vec { - let mut _lst: Vec = Vec::new(); - - for idx in 0..(lst.len() - 1) { - if lst[idx] == lst[idx + 1] { - _lst.push(lst[idx]); - } - } - - return _lst -} - -fn main() { - let check = vec![1, 2, 2, 2, 3, 3, 4]; - println!("{:?}", same_to_next(&check)); // [2, 2, 3] - - let check: Vec = (1..=10).collect(); - println!("{:?}", same_to_next(&check)); // [] -} \ No newline at end of file