Skip to content

Commit 1855376

Browse files
committed
setup: leetcode problem 1672, computing richest customer's wealth -@iamserda
1 parent 6f54693 commit 1855376

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

leetcode/1672/challenge.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def maximumWealth(self, accounts: list[list[int]]) -> int:
3+
pass
4+
5+
6+
sol = Solution()
7+
assert sol.maximumWealth([[1, 2, 3], [3, 2, 1]]) == 6
8+
assert sol.maximumWealth([[1, 2, 3], [4, 5, 7], [1, 3, 9]]) == 16
9+
assert sol.maximumWealth([[2, 8, 7], [7, 1, 3], [1, 9, 5]]) == 17

leetcode/1672/readme.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 0. [Problem Title](https://example.com/)
2+
3+
## Description
4+
5+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitia,
6+
molestiae quas numquam blanditiis harum quisquam!
7+
8+
Provident similique accusantium nemo autem. Veritatis obcaecati tenetur iure eius earum ut molestias architecto voluptate aliquam nihil.
9+
10+
Reprehenderit, quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente offici is modi at sunt excepturi expedita sint?
11+
12+
## Examples
13+
14+
**Example 1:**
15+
16+
Input: `nums = [2,7,11,15], target = 9`
17+
Output: `[0,1]`
18+
Reasoning: Because `nums[0] + nums[1] == 9`, we return `[0, 1]`.
19+
20+
**Example 2:**
21+
22+
Input: `nums = [3,2,4], target = 6`
23+
Output: `[1,2]`
24+
25+
**Example 3:**
26+
27+
Input: nums = `[3,3], target = 6`
28+
Output: `[0,1]`
29+
30+
## constraints
31+
32+
- `2 <= nums.length <= 104`
33+
- `109 <= nums[i] <= 109`
34+
- `109 <= target <= 109`
35+
- **Only one valid answer exists.**
36+
37+
**Follow-up:**
38+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitia,
39+
molestiae quas numquam blanditiis harum quisquam!
40+
41+
## Credits, Source, Etc
42+
43+
- Source: [LeetCode](https://leetcode.com/problems/merge-sorted-array/description/)
44+
- [github: @iamserda](https://github.com/iamserda)
45+
- [twitter: @iamserda](https://twitter.com/iamserda)
46+
- [linkedin: @iamserda](https://linkedin.com/in/iamserda)
47+
48+
Made with 🤍🫶🏿 in N🗽C by [@iamserda](https://www.twitter.com/iamserda)

leetcode/1672/solutions.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution:
2+
def maximumWealth(self, accounts: list[list[int]]) -> int:
3+
pass
4+
5+
6+
sol = Solution()
7+
assert sol.maximumWealth([[1, 2, 3], [3, 2, 1]]) == 6
8+
assert sol.maximumWealth([[1, 2, 3], [4, 5, 7], [1, 3, 9]]) == 16
9+
assert sol.maximumWealth([[2, 8, 7], [7, 1, 3], [1, 9, 5]]) == 17

0 commit comments

Comments
 (0)