Skip to content

fix: update code blocks #2210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func longestSubarray(nums []int, limit int) (ans int) {

### **TypeScript**

````ts
```ts
function longestSubarray(nums: number[], limit: number): number {
const ts = new TreapMultiSet<number>();
let ans = 0;
Expand Down Expand Up @@ -281,37 +281,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
private readonly leftBound: T;
private readonly rightBound: T;

/**
*
* @param compareFn A compare function which returns boolean or number
* @param leftBound defalut value is `-Infinity`
* @param rightBound defalut value is `Infinity`
* @description
* create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
* @example
* ```ts
* interface Person {
name: string
age: number
}

const leftBound = {
name: 'Alice',
age: -Infinity,
}

const rightBound = {
name: 'Bob',
age: Infinity,
}

const sortedList = new TreapMultiSet<Person>(
(a: Person, b: Person) => a.age - b.age,
leftBound,
rightBound
)
* ```
*/
constructor(compareFn?: CompareFunction<T, 'number'>);
constructor(compareFn: CompareFunction<T, 'number'>, leftBound: T, rightBound: T);
constructor(
Expand Down Expand Up @@ -828,7 +797,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
yield* this.reverseInOrder(root.left);
}
}
````
```

### **...**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func longestSubarray(nums []int, limit int) (ans int) {

### **TypeScript**

````ts
```ts
function longestSubarray(nums: number[], limit: number): number {
const ts = new TreapMultiSet<number>();
let ans = 0;
Expand Down Expand Up @@ -266,37 +266,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
private readonly leftBound: T;
private readonly rightBound: T;

/**
*
* @param compareFn A compare function which returns boolean or number
* @param leftBound defalut value is `-Infinity`
* @param rightBound defalut value is `Infinity`
* @description
* create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
* @example
* ```ts
* interface Person {
name: string
age: number
}

const leftBound = {
name: 'Alice',
age: -Infinity,
}

const rightBound = {
name: 'Bob',
age: Infinity,
}

const sortedList = new TreapMultiSet<Person>(
(a: Person, b: Person) => a.age - b.age,
leftBound,
rightBound
)
* ```
*/
constructor(compareFn?: CompareFunction<T, 'number'>);
constructor(compareFn: CompareFunction<T, 'number'>, leftBound: T, rightBound: T);
constructor(
Expand Down Expand Up @@ -813,7 +782,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
yield* this.reverseInOrder(root.left);
}
}
````
```

### **...**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,37 +113,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
private readonly leftBound: T;
private readonly rightBound: T;

/**
*
* @param compareFn A compare function which returns boolean or number
* @param leftBound defalut value is `-Infinity`
* @param rightBound defalut value is `Infinity`
* @description
* create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
* @example
* ```ts
* interface Person {
name: string
age: number
}

const leftBound = {
name: 'Alice',
age: -Infinity,
}

const rightBound = {
name: 'Bob',
age: Infinity,
}

const sortedList = new TreapMultiSet<Person>(
(a: Person, b: Person) => a.age - b.age,
leftBound,
rightBound
)
* ```
*/
constructor(compareFn?: CompareFunction<T, 'number'>);
constructor(compareFn: CompareFunction<T, 'number'>, leftBound: T, rightBound: T);
constructor(
Expand Down
35 changes: 2 additions & 33 deletions solution/2600-2699/2612.Minimum Reverse Operations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ class TreeMultiSet<T = number> {
}
```

````ts
```ts
function minReverseOperations(n: number, p: number, banned: number[], k: number): number[] {
const ans = new Array(n).fill(-1);
const ts = new Array(2).fill(0).map(() => new TreapMultiSet<number>());
Expand Down Expand Up @@ -1049,37 +1049,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
private readonly leftBound: T;
private readonly rightBound: T;

/**
*
* @param compareFn A compare function which returns boolean or number
* @param leftBound defalut value is `-Infinity`
* @param rightBound defalut value is `Infinity`
* @description
* create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
* @example
* ```ts
* interface Person {
name: string
age: number
}

const leftBound = {
name: 'Alice',
age: -Infinity,
}

const rightBound = {
name: 'Bob',
age: Infinity,
}

const sortedList = new TreapMultiSet<Person>(
(a: Person, b: Person) => a.age - b.age,
leftBound,
rightBound
)
* ```
*/
constructor(compareFn?: CompareFunction<T, 'number'>);
constructor(compareFn: CompareFunction<T, 'number'>, leftBound: T, rightBound: T);
constructor(
Expand Down Expand Up @@ -1596,7 +1565,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
yield* this.reverseInOrder(root.left);
}
}
````
```

### **...**

Expand Down
35 changes: 2 additions & 33 deletions solution/2600-2699/2612.Minimum Reverse Operations/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ class TreeMultiSet<T = number> {
}
```

````ts
```ts
function minReverseOperations(n: number, p: number, banned: number[], k: number): number[] {
const ans = new Array(n).fill(-1);
const ts = new Array(2).fill(0).map(() => new TreapMultiSet<number>());
Expand Down Expand Up @@ -1035,37 +1035,6 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
private readonly leftBound: T;
private readonly rightBound: T;

/**
*
* @param compareFn A compare function which returns boolean or number
* @param leftBound defalut value is `-Infinity`
* @param rightBound defalut value is `Infinity`
* @description
* create a `MultiSet`, compare elements using `compareFn`, which is increasing order by default.
* @example
* ```ts
* interface Person {
name: string
age: number
}

const leftBound = {
name: 'Alice',
age: -Infinity,
}

const rightBound = {
name: 'Bob',
age: Infinity,
}

const sortedList = new TreapMultiSet<Person>(
(a: Person, b: Person) => a.age - b.age,
leftBound,
rightBound
)
* ```
*/
constructor(compareFn?: CompareFunction<T, 'number'>);
constructor(compareFn: CompareFunction<T, 'number'>, leftBound: T, rightBound: T);
constructor(
Expand Down Expand Up @@ -1582,7 +1551,7 @@ class TreapMultiSet<T = number> implements ITreapMultiSet<T> {
yield* this.reverseInOrder(root.left);
}
}
````
```

### **...**

Expand Down