We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6ce0c9 commit 3458800Copy full SHA for 3458800
lesson_11/arrays_ts/src/lesson11.ts
@@ -3,13 +3,25 @@
3
* https://leetcode.com/problems/concatenation-of-array
4
*/
5
export function getConcatenation(nums: number[]): number[] {
6
- return [];
+ if (nums.length === 0) return [];
7
+ const result = [...nums];
8
+ for (const num of nums) {
9
+ result.push(num);
10
+ }
11
+ return result;
12
}
13
14
/**
15
* Provide the solution to LeetCode 2942 here:
16
* https://leetcode.com/problems/find-words-containing-character/
17
18
export function findWordsContaining(words: string[], x: string): number[] {
19
+ if (words.length === 0) return [];
20
+ const result = [];
21
+ for (let i = 0; i < words.length; i++) {
22
+ if (words[i].includes(x)) {
23
+ result.push(i);
24
25
26
27
0 commit comments