Skip to content

Commit 9213c1a

Browse files
ibrahimaquaibrahim Al-Aqua
andauthored
Add solution for problem 1672: richest customer wealth (#178)
* Add solution for problem 1672: richest customer wealth * Fix GitHub Actions: Update actions/cache from v1 to v4 - Update actions/cache@v1 to actions/cache@v4 in UnitTest.yml - Update actions/cache@v1 to actions/cache@v4 in documentation.yml - Fixes deprecation warning that was causing CI failures --------- Co-authored-by: ibrahim Al-Aqua <[email protected]>
1 parent b90d3cd commit 9213c1a

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.github/workflows/UnitTest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
version: ${{ matrix.julia-version }}
2626

2727
- name: Cache artifacts
28-
uses: actions/cache@v1
28+
uses: actions/cache@v4
2929
env:
3030
cache-name: cache-artifacts
3131
with:

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
version: ${{ matrix.julia-version }}
2525
- name: Cache artifacts
26-
uses: actions/cache@v1
26+
uses: actions/cache@v4
2727
env:
2828
cache-name: cache-artifacts
2929
with:

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)