Skip to content

Commit e8bea14

Browse files
authored
feat: add kotlin solution to lc problem: No.1672 (doocs#830)
No.1672. Richest Customer Wealth
1 parent 6ce3235 commit e8bea14

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

solution/1600-1699/1672.Richest Customer Wealth/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,23 @@ impl Solution {
146146
}
147147
```
148148

149+
### **Kotlin**
150+
151+
```kotlin
152+
class Solution {
153+
fun maximumWealth(accounts: Array<IntArray>): Int {
154+
var max = 0
155+
for (account in accounts) {
156+
val sum = account.sum()
157+
if (sum > max) {
158+
max = sum
159+
}
160+
}
161+
return max
162+
}
163+
}
164+
```
165+
149166
### **...**
150167

151168
```

solution/1600-1699/1672.Richest Customer Wealth/README_EN.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,23 @@ impl Solution {
139139
}
140140
```
141141

142+
### **Kotlin**
143+
144+
```kotlin
145+
class Solution {
146+
fun maximumWealth(accounts: Array<IntArray>): Int {
147+
var max = 0
148+
for (account in accounts) {
149+
val sum = account.sum()
150+
if (sum > max) {
151+
max = sum
152+
}
153+
}
154+
return max
155+
}
156+
}
157+
```
158+
142159
### **...**
143160

144161
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
fun maximumWealth(accounts: Array<IntArray>): Int {
3+
var max = 0
4+
for (account in accounts) {
5+
val sum = account.sum()
6+
if (sum > max) {
7+
max = sum
8+
}
9+
}
10+
return max
11+
}
12+
}

0 commit comments

Comments
 (0)