Skip to content

Commit d4f5973

Browse files
authored
Added 2028
1 parent 7beac22 commit d4f5973

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def missingRolls(self, rolls: list[int], mean: int, n: int) -> list[int]:
3+
targetSum = (len(rolls) + n) * mean
4+
missingSum = targetSum - sum(rolls)
5+
if missingSum > n * 6 or missingSum < n:
6+
return []
7+
8+
ans = [missingSum // n] * n
9+
for i in range(missingSum % n):
10+
ans[i] += 1
11+
12+
return ans

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ This repository contains solutions to over 500 Leetcode problems that are organi
184184
| 1964 | Find the Longest Valid Obstacle Course at Each Position | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@_monitsharma/daily-leetcode-problems-problem-1964-find-the-longest-valid-obstacle-course-at-each-position-ade63a37c125) |
185185
| 1970 | Last Day Where You Can Still Cross | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@_monitsharma/daily-leetcode-problems-problem-1970-last-day-where-you-can-still-cross-694827e6055) |
186186
| 2009 | Minimum Number of Operations to Make Array Continuous | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@_monitsharma/daily-leetcode-problems-2009-minimum-number-of-operations-to-make-array-continuous-334e1e25f826) |
187-
| 2022 | Convert 1D Array Into 2D Array | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)]() |
187+
| 2022 | Convert 1D Array Into 2D Array | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://github.com/MonitSharma/LeetCode-Solutions/tree/main/2022-converting-1d-to-2d) |
188+
| 2028 | Find Missing Observation | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)]() |
188189
| 2024 | Maximize the confusion of an Exam | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@_monitsharma/daily-leetcode-problems-problem-2024-maximize-the-confusion-of-an-exam-1754351c0c60) |
189190
| 2038 | Remove Colored Pieces if Both Neighbors are the same color | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@_monitsharma/daily-leetcode-problems-2038-remove-colored-pieces-if-both-neighbors-are-the-same-color-aec52bf4300d) |
190191
| 2050 | Parallel Courses III | [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@_monitsharma/daily-leetcode-problems-2050-parallel-courses-iii-87d84ef83437) |

0 commit comments

Comments
 (0)