
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ [Best Time to Buy and Sell Stock] 잘못 풀었다. 요구사항 1. prices 의 가격 차이 max가 얼마인가 → 배열 오름차순 sort 후 0번 index(맨앞) 마지막 index(맨뒤) 비교 2. 가격차이 max 를 만드는 big과 small 의 index가 오름차순 순서인가 → index 비교(big의 index가 small의 index보다 큰지. → big의 인덱스가 더 작다면 small 의 인덱스 1 증가 후 비교 로직 기존 prices 배열 map 에 key: prices[index] , value: index 로 저장 Map priceMap = new Has..