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