Skip to content

Commit 284f88d

Browse files
authored
Create find-words-containing-character.py
1 parent 670bc32 commit 284f88d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Time: O(n * l)
2+
# Space: O(1)
3+
4+
# string
5+
class Solution(object):
6+
def findWordsContaining(self, words, x):
7+
"""
8+
:type words: List[str]
9+
:type x: str
10+
:rtype: List[int]
11+
"""
12+
return [i for i, w in enumerate(words) if x in w]

0 commit comments

Comments
 (0)