[프로그래머스] 주식가격
·
PS
이 문제는 프로그래머스 LV2에 해당하는 코딩테스트 문제다.'스택/큐'에 대한 개념이 아직 잘 잡혀있지 않아서 나는 문제를 처음 보고 이중for문을 사용하는 방식으로 접근했다.아래 코드는 이중for문을 활용한 방식이다.class Solution { public int[] solution(int[] prices) { int[] arr = new int[prices.length]; for (int i=0; i prices[j]) { break; } } arr[i] = count; } return arr; ..