Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
처음에는 객체지향 방법으로 다가가 문제를 풀었으나 정확성은 100%이나 효율성 테스트 부분에서 실패 다시 문제를 풀었습니다.
새로운 문제 풀이 방법은 이중 for문을 사용하여 비교하였고 앞에 price부터 하나하나 timer를 구하는 형식으로 문제를 풀었습니다.
더 나은 문제 풀이 방법이 있을 것 같은데 문득 생각이 나지가 않았습니다.
그냥 밑은 자료구조를 이용해 문제를 풀었길래 한번 봤습니다.
개인적으로는 크게 의미가 있을지는 모르겠습니다.
public int[] solution(int[] prices) {
Stack beginIdxs = new Stack<>();
int i=0;
int[] terms = new int[prices.length];