Easy

Find Words Containing CharacterPython

Full explanation · Time O(n * l) · Space O(1)

# Time:  O(n * l)
# Space: O(1)

# string
class Solution(object):
    def findWordsContaining(self, words, x):
        """
        :type words: List[str]
        :type x: str
        :rtype: List[int]
        """
        return [i for i, w in enumerate(words) if x in w]