Skip to content

Commit 7cb85ec

Browse files
feat: implemented leetCode 1929, 2942
1 parent 3e8f77b commit 7cb85ec

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lesson_11/arrays_ts/src/lesson11.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@
33
* https://leetcode.com/problems/concatenation-of-array
44
*/
55
export function getConcatenation(nums: number[]): number[] {
6-
return [];
6+
return [...nums, ...nums]
77
}
88

99
/**
1010
* Provide the solution to LeetCode 2942 here:
1111
* https://leetcode.com/problems/find-words-containing-character/
1212
*/
1313
export function findWordsContaining(words: string[], x: string): number[] {
14-
return [];
14+
let ans = [];
15+
16+
for(let i = 0; i<words.length; i++){
17+
if (words[i].includes(x)){
18+
ans.push(i);
19+
}
20+
}
21+
22+
return ans;
1523
}

0 commit comments

Comments
 (0)