O60
Minimum Number of Arrows to Burst Balloons
Problem Statement & Objective
Find the minimum number of arrows that must be shot to burst all balloons given their x-intervals.
Function Signature (Python)
minimum_number_of_arrows_to(points: list[list[int]]) -> intInput & Output Contract
Output Rule:Minimum ok sayısı (tam sayı).
System Constraints
1 <= noktalar.length <= 10^5
-2^31 <= x_baslangic < x_bitis <= 2^31 - 1Example Execution Walkthrough
noktalar = [[10, 16], [2, 8], [1, 6], [7, 12]]
x = 6 oku [2, 8] ve [1, 6]'yı patlatır.
x = 11 oku [10, 16] ve [7, 12]'yi patlatır.
cevap: 2 okExample Test Scenarios (3)
Example 1
Input:
[[[10,16],[2,8],[1,6],[7,12]]]Expected Output:
2Example 2: Ayrık Balonlar
Input:
[[[1,2],[3,4],[5,6],[7,8]]]Expected Output:
4Example 3: Uç Uca Bitişik
Input:
[[[1,2],[2,3],[3,4],[4,5]]]Expected Output:
2