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 6e709a2 commit 15e1f13Copy full SHA for 15e1f13
lesson_11/arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11/Lesson11.java
@@ -1,5 +1,6 @@
1
package com.codedifferently.lesson11;
2
3
+import java.util.ArrayList;
4
import java.util.List;
5
6
public class Lesson11 {
@@ -26,6 +27,13 @@ public int[] getConcatenation(int[] nums) {
26
27
* https://leetcode.com/problems/find-words-containing-character/
28
*/
29
public List<Integer> findWordsContaining(String[] words, char x) {
- return null;
30
+ List<Integer> indices = new ArrayList<>();
31
+
32
+ for (int i = 0; i < words.length; i++){
33
+ if(words[i].indexOf(x) >= 0){
34
+ indices.add(i);
35
+ }
36
37
+ return indices;
38
}
39
0 commit comments