Skip to content

Instantly share code, notes, and snippets.

@SeemabMehmood
Created September 20, 2023 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeemabMehmood/1e5cf89606fccd9e37d2623930eb81ad to your computer and use it in GitHub Desktop.
Save SeemabMehmood/1e5cf89606fccd9e37d2623930eb81ad to your computer and use it in GitHub Desktop.
Richest Customer Wealth
accounts = [[7, 1, 3],
[2, 8, 7],
[1, 9, 5]]
sums = []
for i in 0..accounts.length
sums << accounts[i].sum
end
sums.max
# Time comp: O(n*m)
# Space Complexity: O(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment