Created
September 20, 2023 04:50
-
-
Save SeemabMehmood/1e5cf89606fccd9e37d2623930eb81ad to your computer and use it in GitHub Desktop.
Richest Customer Wealth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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