1832. Check if the Sentence Is Pangram
1 | class Solution { |
Bit Manipulation.
用一个int中的bits来存每个letter是否出现. bit 0存a, bit 1存b…
最后看这个int是否等于1 << 26 再减去1.
时间复杂度: O(n)
空间复杂度: O(1)
Insist on doing small things, then witness the magic
1 | class Solution { |
Bit Manipulation.
用一个int中的bits来存每个letter是否出现. bit 0存a, bit 1存b…
最后看这个int是否等于1 << 26 再减去1.
时间复杂度: O(n)
空间复杂度: O(1)