Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3207077

Browse files
committed
Add Richest Customer Wealth
1 parent 01a045f commit 3207077

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Problem: https://leetcode.com/problems/richest-customer-wealth/
2+
using System;
3+
4+
namespace LeetCode {
5+
public partial class Solution {
6+
public int MaximumWealth(int[][] accounts) {
7+
int sum = 0;
8+
int count = 0;
9+
for (int i = 0; i < accounts.Length; i++) {
10+
count = 0;
11+
for(int j =0; j < accounts[i].Length; j++) {
12+
count += accounts[i][j];
13+
}
14+
sum = Math.Max(sum,count);
15+
}
16+
return sum;
17+
}
18+
}
19+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ LeetCode C# solutions
2222
|**1556**| **[Thousand Separator](https://leetcode.com/problems/thousand-separator/)** | **[C#](https://github.com/ocimen/leetcode/blob/main/LeetCode/1556-ThousandSeparator.cs)** | **Easy** |
2323
|**1603**| **[Design Parking System](https://leetcode.com/problems/design-parking-system/)** | **[C#](https://github.com/ocimen/leetcode/blob/main/LeetCode/1603-DesignParkingSystem.cs)** | **Easy** |
2424
|**1662**| **[Check If Two String Arrays are Equivalent](https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/)** | **[C#](https://github.com/ocimen/leetcode/blob/main/LeetCode/1662-CheckIfTwoStringArraysareEquivalent.cs)** | **Easy** |
25+
|**1672**| **[Richest Customer Wealth](https://leetcode.com/problems/richest-customer-wealth/)** | **[C#](https://github.com/ocimen/leetcode/blob/main/LeetCode/1672-RichestCustomerWealth.cs)** | **Easy** |
2526
|**1678**| **[Goal Parser Interpretation](https://leetcode.com/problems/goal-parser-interpretation/)** | **[C#](https://github.com/ocimen/leetcode/blob/main/LeetCode/1678-GoalParserInterpretation.cs)** | **Easy** |
2627
|**1684**| **[Count the Number of Consistent Strings](https://leetcode.com/problems/count-the-number-of-consistent-strings/)** | **[C#](https://github.com/ocimen/leetcode/blob/main/LeetCode/1684-CountNumberConsistentStrings.cs)** | **Easy** |

0 commit comments

Comments
 (0)