Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
  • Loading branch information
imteekay committed Nov 26, 2023
1 parent 914a19d commit e6bc604
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// https://leetcode.com/problems/find-words-containing-character

function findWordsContaining(words, x) {
let indices = [];

for (let index = 0; index < words.length; index++) {
for (let char of words[index]) {
if (char === x) {
indices.push(index);
break;
}
}
}

return indices;
}

0 comments on commit e6bc604

Please sign in to comment.