Leetcode Note: Go - Check if the Sentence Is Pangram

Check if the Sentence Is Pangram - LeetCode
https://leetcode.com/problems/check-if-the-sentence-is-pangram/

  • Go 言語で取り組んだメモ

回答

Golang short solution - Check if the Sentence Is Pangram - LeetCode
https://leetcode.com/problems/check-if-the-sentence-is-pangram/solutions/2715080/golang-short-solution/

func checkIfPangram(sentence string) bool {
    store:=make(map[rune]struct{})
    for _,ch:=range sentence{
        if _,ok:=store[ch];!ok{
            store[ch]=struct{}{}
        }
    }
    return len(store)==26
}