Skip to content

Commit 5348b99

Browse files
author
ibrahim Al-Aqua
committed
Add solution for problem 1672: richest customer wealth
1 parent b90d3cd commit 5348b99

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/unresolved/1672.richest-customer-wealth.jl renamed to src/problems/1672.richest-customer-wealth.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ---
22
# title: 1672. Richest Customer Wealth
33
# id: problem1672
4-
# author: Tian Jun
5-
# date: 2020-10-31
4+
# author: Ibrahim Al-Aqua
5+
# date: 2025-08-05
66
# difficulty: Easy
77
# categories: Array
88
# link: <https://leetcode.com/problems/richest-customer-wealth/description/>
@@ -65,5 +65,8 @@
6565
## @lc code=start
6666
using LeetCode
6767

68-
## add your code here:
68+
function maximumWealth(accounts::Array{<:Integer,2})::Int
69+
return maximum(sum(accounts; dims=2))
70+
end
71+
6972
## @lc code=end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@testset "1672.richest-customer-wealth.jl" begin
2+
@test maximumWealth([1 2 3; 3 2 1]) == 6
3+
@test maximumWealth([1 5; 7 3; 3 5]) == 10
4+
@test maximumWealth([2 8 7; 7 1 3; 1 9 5]) == 17
5+
end

0 commit comments

Comments
 (0)