feat: 1672_richest_customer_wealth

This commit is contained in:
SquidSpirit 2025-08-20 02:33:22 +08:00
parent 91053d7e3d
commit ed02a5e2cc
3 changed files with 24 additions and 0 deletions

7
1672_richest_customer_wealth/Cargo.lock generated Normal file
View 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"

View File

@ -0,0 +1,6 @@
[package]
name = "richest_customer_wealth"
version = "0.1.0"
edition = "2024"
[dependencies]

View 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()
}
}