Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 55d676e

Browse files
committed
Update 0452.用最少数量的箭引爆气球,添加C#
1 parent 709b5ba commit 55d676e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎problems/0452.用最少数量的箭引爆气球.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,24 @@ object Solution {
332332
}
333333
}
334334
```
335+
### C#
336+
```csharp
337+
public class Solution
338+
{
339+
public int FindMinArrowShots(int[][] points)
340+
{
341+
if (points.Length == 0) return 0;
342+
Array.Sort(points, (a, b) => a[0].CompareTo(b[0]));
343+
int count = 1;
344+
for (int i = 1; i < points.Length; i++)
345+
{
346+
if (points[i][0] > points[i - 1][1]) count++;
347+
else points[i][1] = Math.Min(points[i][1], points[i - 1][1]);
348+
}
349+
return count;
350+
}
351+
}
352+
```
335353

336354
<p align="center">
337355
<a href="https://programmercarl.com/other/kstar.html" target="_blank">

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /