mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
Update 0452.用最少数量的箭引爆气球.md
This commit is contained in:
@ -272,6 +272,9 @@ int findMinArrowShots(int** points, int pointsSize, int* pointsColSize){
|
|||||||
```Rust
|
```Rust
|
||||||
impl Solution {
|
impl Solution {
|
||||||
pub fn find_min_arrow_shots(mut points: Vec<Vec<i32>>) -> i32 {
|
pub fn find_min_arrow_shots(mut points: Vec<Vec<i32>>) -> i32 {
|
||||||
|
if points.is_empty() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
points.sort_by_key(|point| point[0]);
|
points.sort_by_key(|point| point[0]);
|
||||||
let mut result = 1;
|
let mut result = 1;
|
||||||
for i in 1..points.len() {
|
for i in 1..points.len() {
|
||||||
|
Reference in New Issue
Block a user