Skip to content

Commit 10d76bc

Browse files
committed
fix: fixes failing check by applying gradlew spotless apply to arrays_app -Joseph Caballero
1 parent 6be73e6 commit 10d76bc

File tree

1 file changed

+16
-15
lines changed
  • lesson_11/arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11

1 file changed

+16
-15
lines changed

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,27 @@ public class Lesson11 {
1010
* https://leetcode.com/problems/concatenation-of-array
1111
*/
1212
public int[] getConcatenation(int[] nums) {
13-
int[] ans = new int[(nums.length + nums.length)] ;
14-
System.arraycopy(nums, 0, ans, 0, nums.length);
15-
System.arraycopy(nums, 0, ans, nums.length, nums.length);
16-
return ans;
17-
}
13+
int[] ans = new int[(nums.length + nums.length)];
14+
System.arraycopy(nums, 0, ans, 0, nums.length);
15+
System.arraycopy(nums, 0, ans, nums.length, nums.length);
16+
return ans;
17+
}
1818

1919
/**
2020
* Provide the solution to LeetCode 2942 here:
2121
* https://leetcode.com/problems/find-words-containing-character/
2222
*/
2323
public List<Integer> findWordsContaining(String[] words, char x) {
24-
List<Integer> num = new ArrayList<>();
25-
for(var i = 0; i<words.length; i++){
26-
var word = String.valueOf(words[i]);
27-
for( var j = 0; j < word.length(); j++){
28-
if(word.contains(String.valueOf(x))){
29-
num.add(i);
30-
break;
31-
}
32-
}
24+
List<Integer> num = new ArrayList<>();
25+
for (var i = 0; i < words.length; i++) {
26+
var word = String.valueOf(words[i]);
27+
for (var j = 0; j < word.length(); j++) {
28+
if (word.contains(String.valueOf(x))) {
29+
num.add(i);
30+
break;
3331
}
34-
return num; }
32+
}
33+
}
34+
return num;
35+
}
3536
}

0 commit comments

Comments
 (0)