We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c38aa0 commit a70a91aCopy full SHA for a70a91a
find word containing char.java
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ public List<Integer> findWordsContaining(String[] words, char x) {
3
+ List<Integer> char_index = new ArrayList<>();
4
+ for (int i = 0 ; i< words.length ; i++) {
5
+ if ( words[i].indexOf(x) != -1){
6
+ char_index.add(i);
7
+ }
8
9
+ return char_index;
10
11
+}
0 commit comments