Skip to content

Commit d302ed9

Browse files
committed
feat:changes made lesson11.java for leetcode/AngelicaC
1 parent 8a34402 commit d302ed9

File tree

1 file changed

+8
-10
lines changed
  • lesson_11/arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11

1 file changed

+8
-10
lines changed

lesson_11/arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11/Lesson11.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@ public int[] getConcatenation(int[] nums) {
2222
* Provide the solution to LeetCode 2942 here:
2323
* https://leetcode.com/problems/find-words-containing-character/
2424
*/
25-
26-
public List<Integer> findWordsContaining(String[] words, char x) {
27-
List<Integer> indices = new ArrayList<>();
28-
for (int i = 0; i < words.length; i++) {
29-
String str = String.valueOf(x);
30-
if (words[i].contains(str)) {
31-
indices.add(i);
32-
}
25+
public List<Integer> findWordsContaining(String[] words, char x) {
26+
List<Integer> indices = new ArrayList<>();
27+
for (int i = 0; i < words.length; i++) {
28+
String str = String.valueOf(x);
29+
if (words[i].contains(str)) {
30+
indices.add(i);
3331
}
34-
return indices;
3532
}
33+
return indices;
3634
}
37-
35+
}

0 commit comments

Comments
 (0)