File tree 3 files changed +34
-1
lines changed
3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {number[][] } accounts
3
+ * @return {number }
4
+ */
5
+ const maximumWealth = ( accounts ) => {
6
+ let max = 0 ;
7
+
8
+ for ( let r = 0 ; r < accounts . length ; r ++ ) {
9
+ let tmpMax = 0 ;
10
+ for ( let c = 0 ; c < accounts [ r ] . length ; c ++ ) {
11
+ tmpMax += accounts [ r ] [ c ] ;
12
+ }
13
+ max = Math . max ( max , tmpMax ) ;
14
+ }
15
+ return max ;
16
+ } ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {number[][] } accounts
3
+ * @return {number }
4
+ */
5
+ const maximumWealth = ( accounts ) => {
6
+ let max = 0 ;
7
+
8
+ for ( let r = 0 ; r < accounts . length ; r ++ ) {
9
+ let tmpMax = 0 ;
10
+ for ( let c = 0 ; c < accounts [ r ] . length ; c ++ ) {
11
+ tmpMax += accounts [ r ] [ c ] ;
12
+ }
13
+ max = Math . max ( max , tmpMax ) ;
14
+ }
15
+ return max ;
16
+ } ;
Original file line number Diff line number Diff line change 74
74
- [ 1365. How Many Numbers Are Smaller Than the Current Number] ( ./1365/ )
75
75
- [ 1512. Number of Good Pairs] ( ./1512/ )
76
76
- [ 1569. Number of Ways to Reorder Array to Get Same BST] ( ./1569/ )
77
+ - [ 1672. Richest Customer Wealth] ( ./1672/ )
77
78
- [ 1791. Find Center of Star Graph] ( ./1791/ )
78
79
- [ 1909. Remove One Element to Make the Array Strictly Increasing] ( ./1909/ )
79
80
- [ 1971. Find if Path Exists in Graph] ( ./1971/ )
@@ -121,7 +122,7 @@ Batch create:
121
122
NOTE: JS IS HERE
122
123
-->
123
124
``` ssh
124
- chapter=79 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
125
+ chapter=1672 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
125
126
```
126
127
> then you can use ` x ` for quick debug.
127
128
You can’t perform that action at this time.
0 commit comments