452. Minimum Number of Arrows to Burst Balloons
·
Algorithm/LeetCode
문제그리디 알고리즘 문제였다. 풍선의 위치(지름)가 범위로 표현되어 주어진다. 여러 풍선이 주어지고, 최대한 적은 갯수의 화살로 모든 풍선을 터트리는 문제였다. 풍선은 겹칠 수 있다(위치 범위가 일부 겹칠 수 있다). 그리디 알고리즘이란 Greedy(탐욕, 욕심쟁이) 이름 처럼 지금 당장 최적의 답을 선택하는 과정을 반복하여 결과를 도출하는 알고리즘이다. 링크: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloonsSolution 1class Solution { public int findMinArrowShots(int[][] points) { int answer = 1; Arrays.sort(poi..