Skip to content

Commit c76d86c

Browse files
authored
2942. Find Words Containing Character solved
2942. Find Words Containing Character
2 parents 5bb18e8 + cba1e3c commit c76d86c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
public:
3+
vector<int> findWordsContaining(vector<string>& words, char x) {
4+
vector<int> ans;
5+
for(int i=0;i<words.size();i++){
6+
for(int j=0;j<words[i].size();j++){
7+
if(words[i][j]==x){
8+
ans.push_back(i);
9+
break;
10+
}
11+
}
12+
}
13+
return ans;
14+
}
15+
};

0 commit comments

Comments
 (0)