File tree 5 files changed +19
-12
lines changed
5 files changed +19
-12
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "tabWidth": 4,
3
+ "useTabs": false,
4
+ "singleQuote": true
5
+ }
Original file line number Diff line number Diff line change 1
1
# Queue
2
2
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
-
9
3
In computer science, a ** queue** is a particular kind of abstract data
10
4
type or collection in which the entities in the collection are
11
5
kept in order and the principle (or only) operations on the
Original file line number Diff line number Diff line change 1
1
# Stack
2
2
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
-
9
3
In computer science, a ** stack** is an abstract data type that serves
10
4
as a collection of elements, with two principal operations:
11
5
Original file line number Diff line number Diff line change
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
+ } ;
Original file line number Diff line number Diff line change
1
+ export default function replaceSpace ( s : string ) : string {
2
+ return s . split ( " " ) . join ( "%20" )
3
+ } ;
4
+
You can’t perform that action at this time.
0 commit comments