/**
* @param {string} allowed
* @param {string[]} words
* @return {number}
*/
var countConsistentStrings = function(allowed, words) {
const allowedMap = new Map();
let result = 0;
for(let el of allowed) {
allowedMap.set(el, 1);
}
for(let word of words) {
result++;
for(let str of word) {
if(!allowedMap.has(str)) {
result --;
break;
}
}
}
return result;
};