From e11b98afa3052a138aba177617ca0ed7da839877 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias Ratajczak" Date: Wed, 12 Jul 2023 13:27:20 +0200 Subject: [PATCH] Revert "starting second approach (95, WIP)" This reverts commit 921f68935677b45094476b1c02bb839131a6d7ac. --- src/euler95/Cargo.toml | 3 --- src/euler95/src/main.rs | 23 ++++------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/euler95/Cargo.toml b/src/euler95/Cargo.toml index 8069e56..269262f 100644 --- a/src/euler95/Cargo.toml +++ b/src/euler95/Cargo.toml @@ -5,9 +5,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] -itertools = "*" - [dev-dependencies] rstest = "0.17" diff --git a/src/euler95/src/main.rs b/src/euler95/src/main.rs index 47bc04c..6decb83 100644 --- a/src/euler95/src/main.rs +++ b/src/euler95/src/main.rs @@ -1,15 +1,8 @@ use std::collections::HashSet; -use itertools::Itertools; - const MAX: usize = 1_000_000; fn main() { - let mut x = build_proper_divisors(3); - x.sort(); - dbg!(x); - panic!(); - let mut chains = vec![]; let mut part_of_any_chain = HashSet::new(); @@ -30,6 +23,10 @@ fn main() { println!("{smallest}"); } +fn build_proper_divisors(max: usize) -> Vec> { + todo!() +} + fn try_build_chain_from_number( max: usize, mut current: usize, @@ -62,18 +59,6 @@ fn try_build_chain_from_number( } } -fn build_proper_divisors(max: usize) -> Vec<(usize, Vec)> { - // let mut result = vec![]; - - let result = (1..max + 1) - .combinations(2) - .map(|v| (v.clone().into_iter().product(), v)) - .collect(); - // result.push(x); - - result -} - fn get_proper_divisors(x: usize) -> Vec { let mut result = vec![1];