Day - 55
Assalamu alaykum, everyone! How are you guys?
I think it is time to share the 55th day of my coding challenge. You know that consistency is the key to success. I mentioned it before as well. So, after this challenge lots of my friends started their own challenges too. It makes me happy. I do not know how they started their own challenges. But I have the best wishes to their challenges. Because they know how they can success.
If you have not started yet, start your own challenge from today. It could be hard but, you can do it. You will learn a lot of things.
/*
?* @param {string[]} words
?* @return {string[]}
?*/
var findWords = function (words) {
? const result = [],
? ? row1 = new Set("qwertyuiop"),
? ? row2 = new Set("asdfghjkl"),
? ? row3 = new Set("zxcvbnm");
? for (let word of words) {
? ? const arr = Array.from(new Set(word.toLowerCase()));
? ? if (arr.every((char) => row1.has(char))) {
? ? ? result.push(word);
? ? }
? ? if (arr.every((char) => row2.has(char))) {
? ? ? result.push(word);
? ? }
? ? if (arr.every((char) => row3.has(char))) {
? ? ? result.push(word);
? ? }
? }
? return result;
};
This is the end of this day. I want to say thanks for your attention, as usual!