File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
lesson_11/arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11 Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ public class Lesson11 {
10
10
* https://leetcode.com/problems/concatenation-of-array
11
11
*/
12
12
public int [] getConcatenation (int [] nums ) {
13
- int n = nums .length ;
14
- int [] ans = new int [n * 2 ];
15
- for (int i = 0 ; i < n ; i ++){
16
- ans [i ] = nums [i ];
17
- ans [i + n ] = nums [i ];
13
+ int n = nums .length ;
14
+ int [] ans = new int [n * 2 ];
15
+ for (int i = 0 ; i < n ; i ++) {
16
+ ans [i ] = nums [i ];
17
+ ans [i + n ] = nums [i ];
18
18
}
19
19
return ans ;
20
20
}
@@ -24,12 +24,12 @@ public int[] getConcatenation(int[] nums) {
24
24
* https://leetcode.com/problems/find-words-containing-character/
25
25
*/
26
26
public List <Integer > findWordsContaining (String [] words , char x ) {
27
- ArrayList <Integer > result = new ArrayList <>();
27
+ ArrayList <Integer > result = new ArrayList <>();
28
28
29
- for (int i = 0 ; i < words .length : i ++) {
30
- if (words [i ].indexOf (x ) != -1 ) {
29
+ for (int i = 0 ; i < words .length ; i ++) {
30
+ if (words [i ].indexOf (x ) != -1 ) {
31
31
result .add (i );
32
- }
32
+ }
33
33
}
34
34
return result ;
35
35
}
You can’t perform that action at this time.
0 commit comments