Skip to content

Commit d657b4e

Browse files
chore: implemented typescript leetCode functions in Lesson11.ts
1 parent 67d6e0d commit d657b4e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lesson_11/arrays_ts/src/lesson11.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@
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+
const results: number[] = [];
15+
for (let i = 0; i < words.length; i++) {
16+
if (words[i].includes(x)) {
17+
results.push(i);
18+
}
19+
}
20+
return results;
1521
}

0 commit comments

Comments
 (0)