We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3035929 + b5f08c0 commit c07765aCopy full SHA for c07765a
1 file changed
ksinji/202510/23 PGM 주식가격.md
@@ -0,0 +1,24 @@
1
+```java
2
+class Solution {
3
+ public int[] solution(int[] prices) {
4
+ int[] answer = new int[prices.length];
5
+
6
+ for(int i = 0; i<prices.length; i++){
7
+ if (prices[i] == 1) {
8
+ answer[i] = prices.length-i-1;
9
+ continue;
10
+ }
11
+ int cnt = 0;
12
+ for (int j=i+1; j<prices.length; j++){
13
+ if (prices[j] < prices[i]) {
14
+ answer[i] = ++cnt;
15
+ break;
16
17
+ else cnt++;
18
19
+ answer[i] = cnt;
20
21
+ return answer;
22
23
+}
24
+```
0 commit comments