Skip to content

Commit b5cbea4

Browse files
committed
feat(playground): add offer 03, 05
1 parent d23b1f0 commit b5cbea4

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 4,
3+
"useTabs": false,
4+
"singleQuote": true
5+
}

src/data-structures/queue/README.md

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Queue
22

3-
_Read this in other languages:_
4-
[_简体中文_](README.zh-CN.md),
5-
[_Русский_](README.ru-RU.md),
6-
[_日本語_](README.ja-JP.md),
7-
[_Português_](README.pt-BR.md)
8-
93
In computer science, a **queue** is a particular kind of abstract data
104
type or collection in which the entities in the collection are
115
kept in order and the principle (or only) operations on the

src/data-structures/stack/README.md

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Stack
22

3-
_Read this in other languages:_
4-
[_简体中文_](README.zh-CN.md),
5-
[_Русский_](README.ru-RU.md),
6-
[_日本語_](README.ja-JP.md),
7-
[_Português_](README.pt-BR.md)
8-
93
In computer science, a **stack** is an abstract data type that serves
104
as a collection of elements, with two principal operations:
115

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default function findRepeatNumber(nums: number[]): number {
2+
const s = new Set();
3+
for (let num of nums) {
4+
if (s.has(num)) {
5+
return num
6+
}
7+
s.add(num)
8+
}
9+
return -1
10+
};
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default function replaceSpace(s: string): string {
2+
return s.split(" ").join("%20")
3+
};
4+

0 commit comments

Comments
 (0)