Golang | Leetcode Golang题解之第452题用最少数量的箭引爆气球-题解:

func findMinArrowShots(points [][]int) int {
    if len(points) == 0 {
        return 0
    }
    sort.Slice(points, func(i, j int) bool { return points[i][1] < points[j][1] })
    maxRight := points[0][1]
    ans := 1
    for _, p := range points {
        if p[0] > maxRight {
            maxRight = p[1]
            ans++
        }
    }
    return ans
}
上一篇:HTB:Unified[WriteUP]


下一篇:Oracle 19C archivelog 还是不可以pdb级别设置, standby db可以