Skip to content

Commit b041cbf

Browse files
committed
Requirements.txt added
1 parent 22e26cf commit b041cbf

File tree

8 files changed

+31
-54
lines changed

8 files changed

+31
-54
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22

33
A curated collection of competitive programming problems and solutions in Python, sourced from the most popular platforms. Every solution is adapted with unit tests for easy verification and learning.
44

5-
---
6-
75
## 📋 Requirements
86

97
- **Python**: 3.13.3
108

11-
---
12-
139
## 🚀 Getting Started
1410

1511
### 1. Create a virtual environment
@@ -43,7 +39,6 @@ docker build --target test -t myapp-test .
4339
docker run --rm myapp-test
4440
```
4541

46-
---
4742

4843
## 🧪 Running Tests
4944

@@ -57,7 +52,6 @@ Or explicitly via the venv Python:
5752
.venv/bin/python -m pytest
5853
```
5954

60-
---
6155

6256
## 🧹 Cleaning Up
6357

@@ -73,7 +67,6 @@ rm -rf .venv
7367

7468
> ⚠️ Note: The cleanup command uses `rm -rf .venv` (not `rm .env`) to remove the virtual environment directory.
7569
76-
---
7770

7871
## 🌐 Platforms
7972

@@ -86,7 +79,6 @@ Solutions are sourced from the following competitive programming platforms:
8679
| Codility | [codility.com](https://www.codility.com) |
8780
| LeetCode | [leetcode.com](https://www.leetcode.com) |
8881

89-
---
9082

9183
## 📁 Project Structure
9284

@@ -98,12 +90,10 @@ Solutions are sourced from the following competitive programming platforms:
9890
└── Dockerfile # Docker configuration
9991
```
10092

101-
---
102-
10393
## 🤝 Contributing
10494

10595
Contributions are welcome! When adding a new solution, please ensure:
10696

10797
1. The solution is placed in the appropriate platform folder.
10898
2. A corresponding unit test is included.
109-
3. All existing tests pass before submitting.
99+
3. All existing tests pass before submitting.

requirements.txt

686 Bytes
Binary file not shown.

src/app/codility/counting_elements/frog_river_one.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Frog River One
2+
Frog River One | https://app.codility.com/programmers/lessons/4-counting_elements/frog_river_one/
33
44
Find the earliest time when a frog can jump to the other side of a river.
55

src/app/codility/counting_elements/max_counters.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ def self.maxCounters.solution(N, A)
8181
"""
8282

8383
class MaxCounters:
84-
# MAX_INT = 100000
85-
# INT_RANGE = (1, MAX_INT)
8684

87-
def solution(self, N: int, A):
85+
def solution(self, N: int, A: list[int]) -> list[int]:
8886
"""
8987
:param N: integer - the number of counters
9088
:param A: a sequence of integers specifying which counter to increase

src/app/leetcode/guess_number_higher_or_lower_ii.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/app/leetcode/ltc_0112_path sum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def dfs(self, root: TreeNode, curSum: int, targetSum: int) -> bool:
2222
if root.left is None and root.right is None:
2323
return curSum == targetSum
2424

25-
return self.dfs(root.left, curSum, targetSum) or self.dfs(root.right, curSum, targetSum)
25+
return self.dfs(root.left, curSum, targetSum) or self.dfs(root.right, curSum, targetSum)

src/app/leetcode/intersection_of_two_linked_lists.py renamed to src/app/leetcode/ltc_0160_intersection_of_two_linked_lists.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""
2-
# https://leetcode.com/articles/intersection-two-linked-lists/
2+
Intersection of Two Linked Lists | https://leetcode.com/problems/intersection-of-two-linked-lists/
3+
4+
https://leetcode.com/articles/intersection-two-linked-lists/
35
46
"""
57

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Guess Number Higher or Lower II | htttp://leetcode.com/problems/guess-number-higher-or-lower-ii/
3+
4+
https://discuss.leetcode.com/topic/51353/simple-dp-solution-with-explanation/2
5+
6+
"""
7+
8+
import sys
9+
10+
class GuessNumberHigherOrLowerII:
11+
12+
def getMoneyAmount(self, n: int) -> int:
13+
dp = [[0] * (n + 1) for _ in range(n + 1)]
14+
for j in range(2, n + 1):
15+
for i in range(j - 1, 0, -1):
16+
global_min = sys.maxsize
17+
for k in range(i + 1, j):
18+
local_max = k + max(dp[i][k - 1], dp[k + 1][j])
19+
global_min = min(global_min, local_max)
20+
if i + 1 == j:
21+
dp[i][j] = i
22+
else:
23+
dp[i][j] = global_min
24+
return dp[1][n]

0 commit comments

Comments
 (0)