File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 206
206
1566|[ Detect Pattern of Length M Repeated K or More Times] ( ./1566-detect-pattern-of-length-m-repeated-k-or-more-times.js ) |Easy|
207
207
1598|[ Crawler Log Folder] ( ./1598-crawler-log-folder.js ) |Easy|
208
208
1668|[ Maximum Repeating Substring] ( ./1668-maximum-repeating-substring.js ) |Easy|
209
+ 1672|[ Richest Customer Wealth] ( ./1672-richest-customer-wealth.js ) |Easy|
209
210
1780|[ Check if Number is a Sum of Powers of Three] ( ./1780-check-if-number-is-a-sum-of-powers-of-three.js ) |Medium|
210
211
1880|[ Check if Word Equals Summation of Two Words] ( ./1880-check-if-word-equals-summation-of-two-words.js ) |Easy|
211
212
1929|[ Concatenation of Array] ( ./1929-concatenation-of-array.js ) |Easy|
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 1672. Richest Customer Wealth
3
+ * https://leetcode.com/problems/richest-customer-wealth/
4
+ * Difficulty: Easy
5
+ *
6
+ * You are given an m x n integer grid accounts where accounts[i][j] is the
7
+ * amount of money the ith customer has in the jth bank. Return the wealth
8
+ * that the richest customer has.
9
+ *
10
+ * A customer's wealth is the amount of money they have in all their bank
11
+ * accounts. The richest customer is the customer that has the maximum wealth.
12
+ */
13
+
14
+ /**
15
+ * @param {number[][] } accounts
16
+ * @return {number }
17
+ */
18
+ var maximumWealth = function ( accounts ) {
19
+ return Math . max ( ...accounts . map ( account => account . reduce ( ( sum , n ) => sum + n ) , 0 ) ) ;
20
+ } ;
You can’t perform that action at this time.
0 commit comments