https://leetcode.com/problems/check-if-a-string-is-an-acronym-of-words/description/
Check if a String Is an Acronym of Words - LeetCode
Can you solve this real interview question? Check if a String Is an Acronym of Words - Given an array of strings words and a string s, determine if s is an acronym of words. The string s is considered an acronym of words if it can be formed by concatenatin
leetcode.com
1 2 3 4 5 6 7 8 9 10 | class Solution: def isAcronym(self, words: List[str], s: str) -> bool: check = '' for word in words: check += word[0] if check == s: return True else: return False | cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2923. Find Champion I (0) | 2023.12.28 |
---|---|
leetcode 2697. Lexicographically Smallest Palindrome (1) | 2023.12.28 |
백준 14913 등차수열에서 항 번호 찾기 (0) | 2023.12.28 |
leetcode 2928. Distribute Candies Among Children I (0) | 2023.12.27 |
leetcode CodeTestcaseTestcaseTest Result2942. Find Words Containing Character (0) | 2023.12.27 |
댓글