Skip to content

Commit e4a2f2f

Browse files
committed
May 24
1 parent 87c2ae5 commit e4a2f2f

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
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 findWordsContaining(self, words: list[str], x: str) -> list[int]:
3+
return [i for i, word in enumerate(words) if x in word]
4+
5+
6+
def main():
7+
words = ['leet', 'code']
8+
x = 'e'
9+
assert Solution().findWordsContaining(words, x) == [0, 1]
10+
11+
words = ['abc', 'bcd', 'aaaa', 'cbc']
12+
x = 'a'
13+
assert Solution().findWordsContaining(words, x) == [0, 2]
14+
15+
words = ['abc', 'bcd', 'aaaa', 'cbc']
16+
x = 'z'
17+
assert Solution().findWordsContaining(words, x) == []
18+
19+
20+
if __name__ == '__main__':
21+
main()

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
| May 20 | [3355. Zero Array Transformation I](https://leetcode.com/problems/zero-array-transformation-i/) | Medium | Solved |
2727
| May 21 | [73. Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | Medium | Solved |
2828
| May 22 | [3362. Zero Array Transformation III](https://leetcode.com/problems/zero-array-transformation-iii/) | Medium | Unsolved |
29-
| May 23 | []() | | |
30-
| May 24 | []() | | |
29+
| May 23 | [3068. Find the Maximum Sum of Node Values](https://leetcode.com/problems/find-the-maximum-sum-of-node-values/) | Hard | Unsolved |
30+
| May 24 | [2942. Find Words Containing Character](https://leetcode.com/problems/find-words-containing-character/) | Easy | Solved |
3131
| May 25 | []() | | |
3232
| May 26 | []() | | |
3333
| May 27 | []() | | |
@@ -40,6 +40,6 @@
4040
## Summary
4141
| Level | Problems | Solved | Unsolved |
4242
| --- | --- | --- | --- |
43-
| Easy | 5 | 5 | 0 |
43+
| Easy | 6 | 6 | 0 |
4444
| Medium | 12 | 9 | 3 |
45-
| Hard | 4 | 1 | 3 |
45+
| Hard | 5 | 1 | 4 |

0 commit comments

Comments
 (0)