Skip to content

Commit 7690c57

Browse files
committed
Jun 01
1 parent 0d4384b commit 7690c57

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Solution:
2+
def distributeCandies(self, n: int, limit: int) -> int:
3+
count = 0
4+
for i in range(min(limit, n) + 1):
5+
if n - i <= limit * 2:
6+
count += min(n - i, limit) - max(0, n - i - limit) + 1
7+
return count
8+
9+
10+
def main():
11+
n = 5
12+
limit = 2
13+
assert Solution().distributeCandies(n, limit) == 3
14+
15+
n = 3
16+
limit = 3
17+
assert Solution().distributeCandies(n, limit) == 10
18+
19+
20+
if __name__ == '__main__':
21+
main()
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# June-LeetCoding-Challenge-2025
2+
3+
4+
## Questions
5+
| Day | Problem | Level | Status |
6+
| --- | --- | --- | --- |
7+
| June 01 | [2929. Distribute Candies Among Children II](https://leetcode.com/problems/distribute-candies-among-children-ii/) | Medium | Unsolved |
8+
| June 02 | []() | | |
9+
| June 03 | []() | | |
10+
| June 04 | []() | | |
11+
| June 05 | []() | | |
12+
| June 06 | []() | | |
13+
| June 07 | []() | | |
14+
| June 08 | []() | | |
15+
| June 09 | []() | | |
16+
| June 10 | []() | | |
17+
| June 11 | []() | | |
18+
| June 12 | []() | | |
19+
| June 13 | []() | | |
20+
| June 14 | []() | | |
21+
| June 15 | []() | | |
22+
| June 16 | []() | | |
23+
| June 17 | []() | | |
24+
| June 18 | []() | | |
25+
| June 19 | []() | | |
26+
| June 20 | []() | | |
27+
| June 21 | []() | | |
28+
| June 22 | []() | | |
29+
| June 23 | []() | | |
30+
| June 24 | []() | | |
31+
| June 25 | []() | | |
32+
| June 26 | []() | | |
33+
| June 27 | []() | | |
34+
| June 28 | []() | | |
35+
| June 29 | []() | | |
36+
| June 30 | []() | | |
37+
38+
39+
## Summary
40+
| Level | Problems | Solved | Unsolved |
41+
| --- | --- | --- | --- |
42+
| Easy | 0 | 0 | 0 |
43+
| Medium | 1 | 0 | 1 |
44+
| Hard | 0 | 0 | 0 |

0 commit comments

Comments
 (0)