This commit is contained in:
parent
de3aca0d83
commit
7fa53c90b0
1 changed files with 13 additions and 0 deletions
13
easy/string_matching_in_an_array.py
Normal file
13
easy/string_matching_in_an_array.py
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# https://leetcode.com/problems/string-matching-in-an-array
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
class Solution:
|
||||||
|
def stringMatching(self, words: List[str]) -> List[str]:
|
||||||
|
result = []
|
||||||
|
for curr in range(len(words)):
|
||||||
|
for another in range(len(words)):
|
||||||
|
if curr != another and words[curr] in words[another]:
|
||||||
|
result.append(words[curr])
|
||||||
|
break
|
||||||
|
return result
|
||||||
Loading…
Add table
Add a link
Reference in a new issue