feat: 1672_richest_customer_wealth
This commit is contained in:
parent
91053d7e3d
commit
ed02a5e2cc
7
1672_richest_customer_wealth/Cargo.lock
generated
Normal file
7
1672_richest_customer_wealth/Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "richest_customer_wealth"
|
||||||
|
version = "0.1.0"
|
6
1672_richest_customer_wealth/Cargo.toml
Normal file
6
1672_richest_customer_wealth/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[package]
|
||||||
|
name = "richest_customer_wealth"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
11
1672_richest_customer_wealth/src/lib.rs
Normal file
11
1672_richest_customer_wealth/src/lib.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
pub struct Solution;
|
||||||
|
|
||||||
|
impl Solution {
|
||||||
|
pub fn maximum_wealth(accounts: Vec<Vec<i32>>) -> i32 {
|
||||||
|
accounts
|
||||||
|
.iter()
|
||||||
|
.map(|assets| assets.iter().sum())
|
||||||
|
.max()
|
||||||
|
.unwrap()
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user