File tree 5 files changed +8
-163
lines changed
1400-1499/1438.Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
2600-2699/2612.Minimum Reverse Operations
5 files changed +8
-163
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ func longestSubarray(nums []int, limit int) (ans int) {
165
165
166
166
### ** TypeScript**
167
167
168
- ```` ts
168
+ ``` ts
169
169
function longestSubarray(nums : number [], limit : number ): number {
170
170
const ts = new TreapMultiSet <number >();
171
171
let ans = 0 ;
@@ -281,37 +281,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
281
281
private readonly leftBound: T ;
282
282
private readonly rightBound: T ;
283
283
284
- /**
285
- *
286
- * @param compareFn A compare function which returns boolean or number
287
- * @param leftBound defalut value is `-Infinity`
288
- * @param rightBound defalut value is `Infinity`
289
- * @description
290
- * create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
291
- * @example
292
- * ```ts
293
- * interface Person {
294
- name: string
295
- age: number
296
- }
297
-
298
- const leftBound = {
299
- name: 'Alice',
300
- age: -Infinity,
301
- }
302
-
303
- const rightBound = {
304
- name: 'Bob',
305
- age: Infinity,
306
- }
307
-
308
- const sortedList = new TreapMultiSet<Person>(
309
- (a: Person, b: Person) => a.age - b.age,
310
- leftBound,
311
- rightBound
312
- )
313
- * ```
314
- */
315
284
constructor (compareFn ? : CompareFunction <T , ' number' >);
316
285
constructor (compareFn : CompareFunction <T , ' number' >, leftBound : T , rightBound : T );
317
286
constructor (
@@ -828,7 +797,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
828
797
yield * this .reverseInOrder (root .left );
829
798
}
830
799
}
831
- ````
800
+ ```
832
801
833
802
### ** ...**
834
803
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ func longestSubarray(nums []int, limit int) (ans int) {
150
150
151
151
### ** TypeScript**
152
152
153
- ```` ts
153
+ ``` ts
154
154
function longestSubarray(nums : number [], limit : number ): number {
155
155
const ts = new TreapMultiSet <number >();
156
156
let ans = 0 ;
@@ -266,37 +266,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
266
266
private readonly leftBound: T ;
267
267
private readonly rightBound: T ;
268
268
269
- /**
270
- *
271
- * @param compareFn A compare function which returns boolean or number
272
- * @param leftBound defalut value is `-Infinity`
273
- * @param rightBound defalut value is `Infinity`
274
- * @description
275
- * create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
276
- * @example
277
- * ```ts
278
- * interface Person {
279
- name: string
280
- age: number
281
- }
282
-
283
- const leftBound = {
284
- name: 'Alice',
285
- age: -Infinity,
286
- }
287
-
288
- const rightBound = {
289
- name: 'Bob',
290
- age: Infinity,
291
- }
292
-
293
- const sortedList = new TreapMultiSet<Person>(
294
- (a: Person, b: Person) => a.age - b.age,
295
- leftBound,
296
- rightBound
297
- )
298
- * ```
299
- */
300
269
constructor (compareFn ? : CompareFunction <T , ' number' >);
301
270
constructor (compareFn : CompareFunction <T , ' number' >, leftBound : T , rightBound : T );
302
271
constructor (
@@ -813,7 +782,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
813
782
yield * this .reverseInOrder (root .left );
814
783
}
815
784
}
816
- ````
785
+ ```
817
786
818
787
### ** ...**
819
788
Original file line number Diff line number Diff line change @@ -113,37 +113,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
113
113
private readonly leftBound : T ;
114
114
private readonly rightBound : T ;
115
115
116
- /**
117
- *
118
- * @param compareFn A compare function which returns boolean or number
119
- * @param leftBound defalut value is `-Infinity`
120
- * @param rightBound defalut value is `Infinity`
121
- * @description
122
- * create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
123
- * @example
124
- * ```ts
125
- * interface Person {
126
- name: string
127
- age: number
128
- }
129
-
130
- const leftBound = {
131
- name: 'Alice',
132
- age: -Infinity,
133
- }
134
-
135
- const rightBound = {
136
- name: 'Bob',
137
- age: Infinity,
138
- }
139
-
140
- const sortedList = new TreapMultiSet<Person>(
141
- (a: Person, b: Person) => a.age - b.age,
142
- leftBound,
143
- rightBound
144
- )
145
- * ```
146
- */
147
116
constructor ( compareFn ?: CompareFunction < T , 'number' > ) ;
148
117
constructor ( compareFn : CompareFunction < T , 'number' > , leftBound : T , rightBound : T ) ;
149
118
constructor (
Original file line number Diff line number Diff line change @@ -916,7 +916,7 @@ class TreeMultiSet<T = number> {
916
916
}
917
917
```
918
918
919
- ```` ts
919
+ ``` ts
920
920
function minReverseOperations(n : number , p : number , banned : number [], k : number ): number [] {
921
921
const ans = new Array (n ).fill (- 1 );
922
922
const ts = new Array (2 ).fill (0 ).map (() => new TreapMultiSet <number >());
@@ -1049,37 +1049,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
1049
1049
private readonly leftBound: T ;
1050
1050
private readonly rightBound: T ;
1051
1051
1052
- /**
1053
- *
1054
- * @param compareFn A compare function which returns boolean or number
1055
- * @param leftBound defalut value is `-Infinity`
1056
- * @param rightBound defalut value is `Infinity`
1057
- * @description
1058
- * create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
1059
- * @example
1060
- * ```ts
1061
- * interface Person {
1062
- name: string
1063
- age: number
1064
- }
1065
-
1066
- const leftBound = {
1067
- name: 'Alice',
1068
- age: -Infinity,
1069
- }
1070
-
1071
- const rightBound = {
1072
- name: 'Bob',
1073
- age: Infinity,
1074
- }
1075
-
1076
- const sortedList = new TreapMultiSet<Person>(
1077
- (a: Person, b: Person) => a.age - b.age,
1078
- leftBound,
1079
- rightBound
1080
- )
1081
- * ```
1082
- */
1083
1052
constructor (compareFn ? : CompareFunction <T , ' number' >);
1084
1053
constructor (compareFn : CompareFunction <T , ' number' >, leftBound : T , rightBound : T );
1085
1054
constructor (
@@ -1596,7 +1565,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
1596
1565
yield * this .reverseInOrder (root .left );
1597
1566
}
1598
1567
}
1599
- ````
1568
+ ```
1600
1569
1601
1570
### ** ...**
1602
1571
Original file line number Diff line number Diff line change @@ -902,7 +902,7 @@ class TreeMultiSet<T = number> {
902
902
}
903
903
```
904
904
905
- ```` ts
905
+ ``` ts
906
906
function minReverseOperations(n : number , p : number , banned : number [], k : number ): number [] {
907
907
const ans = new Array (n ).fill (- 1 );
908
908
const ts = new Array (2 ).fill (0 ).map (() => new TreapMultiSet <number >());
@@ -1035,37 +1035,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
1035
1035
private readonly leftBound: T ;
1036
1036
private readonly rightBound: T ;
1037
1037
1038
- /**
1039
- *
1040
- * @param compareFn A compare function which returns boolean or number
1041
- * @param leftBound defalut value is `-Infinity`
1042
- * @param rightBound defalut value is `Infinity`
1043
- * @description
1044
- * create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
1045
- * @example
1046
- * ```ts
1047
- * interface Person {
1048
- name: string
1049
- age: number
1050
- }
1051
-
1052
- const leftBound = {
1053
- name: 'Alice',
1054
- age: -Infinity,
1055
- }
1056
-
1057
- const rightBound = {
1058
- name: 'Bob',
1059
- age: Infinity,
1060
- }
1061
-
1062
- const sortedList = new TreapMultiSet<Person>(
1063
- (a: Person, b: Person) => a.age - b.age,
1064
- leftBound,
1065
- rightBound
1066
- )
1067
- * ```
1068
- */
1069
1038
constructor (compareFn ? : CompareFunction <T , ' number' >);
1070
1039
constructor (compareFn : CompareFunction <T , ' number' >, leftBound : T , rightBound : T );
1071
1040
constructor (
@@ -1582,7 +1551,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
1582
1551
yield * this .reverseInOrder (root .left );
1583
1552
}
1584
1553
}
1585
- ````
1554
+ ```
1586
1555
1587
1556
### ** ...**
1588
1557
You can’t perform that action at this time.
0 commit comments