diff --git a/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/Cargo.lock b/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/Cargo.lock new file mode 100644 index 0000000..3d0f0d7 --- /dev/null +++ b/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "find_minimum_operations_to_make_all_elements_divisible_by_three" +version = "0.1.0" diff --git a/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/Cargo.toml b/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/Cargo.toml new file mode 100644 index 0000000..a020d6c --- /dev/null +++ b/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "find_minimum_operations_to_make_all_elements_divisible_by_three" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/src/lib.rs b/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/src/lib.rs new file mode 100644 index 0000000..65a3d47 --- /dev/null +++ b/3190_find_minimum_operations_to_make_all_elements_divisible_by_three/src/lib.rs @@ -0,0 +1,7 @@ +pub struct Solution; + +impl Solution { + pub fn minimum_operations(nums: Vec) -> i32 { + nums.iter().filter(|&num| num % 3 != 0).count() as i32 + } +}