2025-08-21 14:26:29 +0000 UTC

Check if a String Is an Acronym of Words

Code

class Solution:
    def isAcronym(self, words: List[str], s: str) -> bool:
        if len(words) != len(s):
            return False
        for i in range(len(words)):
            if words[i][0] != s[i]:
                return False
        return True