bumpsoo 2025-01-07 20:23:17 +09:00
parent de3aca0d83
commit 7fa53c90b0

View 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