Skip to content

Commit c6d9fb2

Browse files
committed
chore: added gradle script
1 parent a78357e commit c6d9fb2

File tree

1 file changed

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

1 file changed

+14
-14
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.codedifferently.lesson11;
22

3+
import java.util.ArrayList;
34
import java.util.List;
45

56
public class Lesson11 {
@@ -9,30 +10,29 @@ public class Lesson11 {
910
* https://leetcode.com/problems/concatenation-of-array
1011
*/
1112
public int[] getConcatenation(int[] nums) {
12-
int n = nums.length;
13-
int[] ans = new int [(2*n)];
14-
for (int i = 0; i < n; i ++) {
15-
ans[i] = nums[i];
16-
ans[i + n] = nums[i];
17-
}
18-
return ans;
13+
int n = nums.length;
14+
int[] ans = new int[(2 * n)];
15+
for (int i = 0; i < n; i++) {
16+
ans[i] = nums[i];
17+
ans[i + n] = nums[i];
1918
}
20-
19+
return ans;
20+
}
2121

2222
/**
2323
* Provide the solution to LeetCode 2942 here:
2424
* https://leetcode.com/problems/find-words-containing-character/
2525
*/
2626
public List<Integer> findWordsContaining(String[] words, char x) {
27-
27+
2828
List<Integer> output = new ArrayList<>();
2929

30-
for (int i = 0; i < words.length; i++) {
30+
for (int i = 0; i < words.length; i++) {
3131

32-
if (words[i].indexOf(x) != -1) {
33-
output.add(i);
34-
}
32+
if (words[i].indexOf(x) != -1) {
33+
output.add(i);
34+
}
3535
}
36-
return output;
36+
return output;
3737
}
3838
}

0 commit comments

Comments
 (0)