Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 510 Bytes

Question_1672.md

File metadata and controls

24 lines (20 loc) · 510 Bytes

LeetCode Records - Question 1672 Richest Customer Wealth

Attempt 1: Use two loops

class Solution {
    public int maximumWealth(int[][] accounts) {
        int max = 0;

        for (int[] account : accounts) {
            int sum = 0;
            for (int amount : account) {
                sum += amount;
            }
            max = Math.max(max, sum);
        }

        return max;
    }
}
  • Runtime: 0 ms (Beats: 100.00%)
  • Memory: 43.04 MB (Beats: 8.97%)