Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bb50c68

Browse files
authoredApr 18, 2021
Create 1832-check-if-the-sentence-is-pangram.js
1 parent d0f755b commit bb50c68

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @param {string} sentence
3+
* @return {boolean}
4+
*/
5+
const checkIfPangram = function(sentence) {
6+
const hash = new Map()
7+
for(let ch of sentence) {
8+
if(!hash.has(ch)) hash.set(ch, 0)
9+
hash.set(ch, hash.get(ch) + 1)
10+
}
11+
return hash.size >= 26
12+
};

0 commit comments

Comments
 (0)
Please sign in to comment.