We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11b2e63 commit b5f08c0Copy full SHA for b5f08c0
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