You are viewing a single comment's thread from:

RE: Learning GoLang with me: Check if the Sentence Is Pangram

in #programming3 years ago

Actually, the code checks if the string contains 26 different runes. That is, I can pick any 26 different runes and make the function return true.

E.g., it says true with the29ick3roønfoxj9mpsoverthelazydo1 which isn't a pangram, of course.
And it also say true with ∧≠€∴þ←↓→ø¶æßð∂ŋ…–—λ«»÷“”ñµ as well (and if you print the len of this, you'll get a surprise: it isn't 26…)
To test it properly, you can start with only the 26 different letters, abcdefghijklmnopqrstuvwxyz
and then replace with different symbols (in the ASCII set just to avoid confusion with UTF-8 codes); e.g., the following is a pangram, too, according to your naive algorithm:

!$%cdefgh&/jklmn()qrs=?'[]
Sort:  

Yes, you are right... this is a LC question and the:
Constraints:
1 <= sentence.length <= 1000
sentence consists of lowercase English letters.

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59026.89
ETH 2655.48
USDT 1.00
SBD 2.50