Skip to content

Commit 4e5778a

Browse files
committed
May 12
1 parent 3c8ff43 commit 4e5778a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from collections import Counter
2+
3+
4+
class Solution:
5+
def __is_number(self, num: int) -> bool:
6+
freqs = Counter(str(num))
7+
return freqs == (self.counts & freqs)
8+
9+
def findEvenNumbers(self, digits: list[int]) -> list[int]:
10+
self.counts = Counter(map(str, digits))
11+
return list(filter(self.__is_number, range(100, 1000, 2)))
12+
13+
14+
def main():
15+
digits = [2, 1, 3, 0]
16+
assert Solution().findEvenNumbers(digits) == [102, 120, 130, 132, 210, 230, 302, 310, 312, 320]
17+
18+
digits = [2, 2, 8, 8, 2]
19+
assert Solution().findEvenNumbers(digits) == [222, 228, 282, 288, 822, 828, 882]
20+
21+
digits = [3, 7, 5]
22+
assert Solution().findEvenNumbers(digits) == []
23+
24+
25+
if __name__ == '__main__':
26+
main()

2025-05-May-LeetCoding-Challenge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| May 09 | [3343. Count Number of Balanced Permutations](https://leetcode.com/problems/count-number-of-balanced-permutations/) | Hard | Unsolved |
1616
| May 10 | [2918. Minimum Equal Sum of Two Arrays After Replacing Zeros](https://leetcode.com/problems/minimum-equal-sum-of-two-arrays-after-replacing-zeros/) | Medium | Solved |
1717
| May 11 | [1550. Three Consecutive Odds](https://leetcode.com/problems/three-consecutive-odds/) | Easy | Solved |
18-
| May 12 | []() | | |
18+
| May 12 | [2094. Finding 3-Digit Even Numbers](https://leetcode.com/problems/finding-3-digit-even-numbers/) | Easy | Solved |
1919
| May 13 | []() | | |
2020
| May 14 | []() | | |
2121
| May 15 | []() | | |
@@ -40,6 +40,6 @@
4040
## Summary
4141
| Level | Problems | Solved | Unsolved |
4242
| --- | --- | --- | --- |
43-
| Easy | 3 | 3 | 0 |
43+
| Easy | 4 | 4 | 0 |
4444
| Medium | 6 | 6 | 0 |
4545
| Hard | 2 | 1 | 1 |

0 commit comments

Comments
 (0)