File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 3
3
* https://leetcode.com/problems/concatenation-of-array
4
4
*/
5
5
export function getConcatenation ( nums : number [ ] ) : number [ ] {
6
- const answer : number [ ] = new Array ( 2 * nums . length ) ;
6
+ const answer : number [ ] = new Array ( 2 * nums . length ) ;
7
7
for ( let i = 0 ; i < nums . length ; i ++ ) {
8
8
answer [ i ] = nums [ i ] ;
9
9
answer [ i + nums . length ] = nums [ i ] ;
@@ -17,14 +17,13 @@ export function getConcatenation(nums: number[]): number[] {
17
17
* https://leetcode.com/problems/find-words-containing-character/
18
18
*/
19
19
export function findWordsContaining ( words : string [ ] , x : string ) : number [ ] {
20
- const result : number [ ] = [ ] ;
21
20
21
+ const result : number [ ] = [ ] ;
22
22
for ( let i = 0 ; i < words . length ; i ++ ) {
23
23
if ( words [ i ] . indexOf ( x ) !== - 1 ) {
24
24
result . push ( i ) ;
25
25
}
26
26
}
27
-
28
27
return result ;
29
28
}
30
29
You can’t perform that action at this time.
0 commit comments