{"id":2844,"date":"2019-06-02T16:59:17","date_gmt":"2019-06-02T07:59:17","guid":{"rendered":"https:\/\/now0930.pe.kr\/wordpress\/?p=2844"},"modified":"2019-06-02T17:02:23","modified_gmt":"2019-06-02T08:02:23","slug":"%ed%94%84%eb%a1%9c%ea%b7%b8%eb%9e%98%eb%a8%b8%ec%8a%a4-%ec%a3%bc%ec%8b%9d%ea%b0%80%ea%b2%a9","status":"publish","type":"post","link":"https:\/\/now0930.pe.kr\/wordpress\/%ed%94%84%eb%a1%9c%ea%b7%b8%eb%9e%98%eb%a8%b8%ec%8a%a4-%ec%a3%bc%ec%8b%9d%ea%b0%80%ea%b2%a9\/","title":{"rendered":"\ud504\ub85c\uadf8\ub798\uba38\uc2a4 \uc8fc\uc2dd\uac00\uaca9"},"content":{"rendered":"\n<p>stack\uc744 \ub9cc\ub4e4\uc5b4\uc11c \ubc14\ub85c int[]\ub85c \ubcc0\uacbd\ud558\ub824 \ud588\uc73c\ub098 \uc548\ub418\uc5c8\ub2e4.\ub2e4\ub984 \uc0ac\ub78c\uc758 \ud480\uc774 \uc5ed\uc2dc \ubc14\ub85c \ubc14\uafb8\uc9c0 \uc54a\uc558\ub2e4. stack\uc73c\ub85c \ub123\uc740 \ub2e4\uc74c \ud558\ub098\uc529 \uc77d\uc5b4 \uc0c8\ub85c \ub9cc\ub4e0 int[]\uc5d0 \uc9d1\uc5b4 \ub123\uc5c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tSolution sol = new Solution();\n\t\tint[] prices = new int[5];\n\t\tprices[0] = 1;\n\t\tprices[1] = 2;\n\t\tprices[2] = 3;\n\t\tprices[3] = 2;\n\t\tprices[4] = 3;\n\n\t\tsol.solution(prices);\n\n\t\tSystem.out.println(\"\uc5ec\uae30\");\n\t}\/\/ void main\n\n} \/\/ Main\n\nclass Solution {\n\tpublic int[] solution(int[] prices) {\n\t\tint[] answer = new int[prices.length];\n\n\t\tint targetTime = 0;\n\t\tfor (int i = 0; i &lt; prices.length-1; i++) {\n\t\t\t\/\/ \ud604\uc7ac \ubaa9\ud45c\uac12.prices[i]\n\t\t\ttargetTime = 0;\n\/\/\t\t\tSystem.out.println(\"\ud604\uc7ac i\ub294\" + i + \",\uac12\uc740\" + prices[i]);\n\n\t\t\tfor (int j = 1; j &lt; prices.length - i; j++) {\n\/\/\t\t\t\tSystem.out.println(\"\ud604\uc7ac i+j\ub294\" + (i + j) + \",\uac12\uc740\" + prices[i + j]);\n\n\t\t\t\tif (prices[i] > prices[i + j]) {\n\t\t\t\t\ttargetTime = targetTime + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t} else\n\t\t\t\t\ttargetTime = targetTime + 1;\n\t\t\t}\n\n\/\/\t\t\tSystem.out.println(\"\ubaa9\ud45c\uac12=\" + targetTime);\n\t\t\tanswer[i] = targetTime;\n\n\t\t}\n\/\/\t\tfor (int i = 0; i &lt; prices.length; i++)\n\/\/\t\t\tSystem.out.println(\"answer=\" + answer[i]);\n\n\t\treturn answer;\n\t} \/\/ solutions\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>stack\uc744 \ub9cc\ub4e4\uc5b4\uc11c \ubc14\ub85c int[]\ub85c \ubcc0\uacbd\ud558\ub824 \ud588\uc73c\ub098 \uc548\ub418\uc5c8\ub2e4.\ub2e4\ub984 \uc0ac\ub78c\uc758 \ud480\uc774 \uc5ed\uc2dc \ubc14\ub85c \ubc14\uafb8\uc9c0 \uc54a\uc558\ub2e4. stack\uc73c\ub85c \ub123\uc740 \ub2e4\uc74c \ud558\ub098\uc529 \uc77d\uc5b4 \uc0c8\ub85c \ub9cc\ub4e0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[98,584,586,585],"class_list":["post-2844","post","type-post","status-publish","format-standard","hentry","category-12","tag-java","tag-programmers","tag-586","tag-585"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/2844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/comments?post=2844"}],"version-history":[{"count":2,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/2844\/revisions"}],"predecessor-version":[{"id":2846,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/2844\/revisions\/2846"}],"wp:attachment":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/media?parent=2844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/categories?post=2844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/tags?post=2844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}