Merge branch 'master' of github.com:youngyangyang04/leetcode-master

This commit is contained in:
programmercarl
2022-05-22 11:12:21 +08:00
60 changed files with 1731 additions and 217 deletions

View File

@@ -193,7 +193,7 @@ func min(a,b int) int{
}
return a
}
```
```
### Javascript
```Javascript
@@ -214,7 +214,31 @@ var findMinArrowShots = function(points) {
};
```
### TypeScript
```typescript
function findMinArrowShots(points: number[][]): number {
const length: number = points.length;
if (length === 0) return 0;
points.sort((a, b) => a[0] - b[0]);
let resCount: number = 1;
let right: number = points[0][1]; // 右边界
let tempPoint: number[];
for (let i = 1; i < length; i++) {
tempPoint = points[i];
if (tempPoint[0] > right) {
resCount++;
right = tempPoint[1];
} else {
right = Math.min(right, tempPoint[1]);
}
}
return resCount;
};
```
### C
```c
int cmp(const void *a,const void *b)
{