{"id":1313,"date":"2024-10-20T20:27:17","date_gmt":"2024-10-20T11:27:17","guid":{"rendered":"https:\/\/blog.dozzing.kr\/?p=1313"},"modified":"2026-03-17T15:10:41","modified_gmt":"2026-03-17T06:10:41","slug":"coding-test-%ec%88%ab%ec%9e%90-%eb%ac%b8%ec%9e%90%ec%97%b4%ea%b3%bc-%ec%98%81%eb%8b%a8%ec%96%b4-%e2%ad%90","status":"publish","type":"post","link":"https:\/\/blog.dozzing.kr\/?p=1313","title":{"rendered":"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50"},"content":{"rendered":"<p><dodo>\ud83d\udc33<strong><yy><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/school.programmers.co.kr\/learn\/courses\/30\/lessons\/81301\">2021 \uce74\uce74\uc624 \ucc44\uc6a9\uc5f0\uacc4\ud615 \uc778\ud134\uc2ed \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50<\/a><\/yy><\/strong> \ucf54\ub529 \ud14c\uc2a4\ud2b8 \ubb38\uc81c\ub97c \ud480\uace0 \uc815\ub9ac\ud55c \uae00\uc785\ub2c8\ub2e4 \ud83d\udc33<\/dodo><\/p>\n<h2>\ud83d\udcab \ubb38\uc81c \uc124\uba85<\/h2>\n<h3>\ub9e4\uac1c\ubcc0\uc218<\/h3>\n<ul>\n<li><code>s<\/code> : \uc22b\uc790\uc758 \uc77c\ubd80 \uc790\ub9bf\uc218\uac00 \uc601\ub2e8\uc5b4\ub85c \ubc14\ub00c\uc5b4\uc84c\uac70\ub098, \ud639\uc740 \ubc14\ub00c\uc9c0 \uc54a\uace0 \uadf8\ub300\ub85c\uc778 \ubb38\uc790\uc5f4\n<ul>\n<li>1 \u2264\u00a0<code>s<\/code>\uc758 \uae38\uc774 \u2264 50<\/li>\n<li><code>s<\/code>\uac00 \"zero\" \ub610\ub294 \"0\"\uc73c\ub85c \uc2dc\uc791\ud558\ub294 \uacbd\uc6b0\ub294 \uc8fc\uc5b4\uc9c0\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/li>\n<li>return \uac12\uc774 1 \uc774\uc0c1 2,000,000,000 \uc774\ud558\uc758 \uc815\uc218\uac00 \ub418\ub294 \uc62c\ubc14\ub978 \uc785\ub825\ub9cc\u00a0<code>s<\/code>\ub85c \uc8fc\uc5b4\uc9d1\ub2c8\ub2e4.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>\uc22b\uc790<\/th>\n<th>\uc601\ub2e8\uc5b4<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0<\/td>\n<td>zero<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>one<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>two<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>three<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>four<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>five<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>six<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>seven<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>eight<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>nine<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u2192 <strong>s<\/strong>\uac00 \uc758\ubbf8\ud558\ub294 \uc6d0\ub798 \uc22b\uc790\ub97c return \ud558\ub3c4\ub85d solution \ud568\uc218\ub97c \uc644\uc131<\/p>\n<hr \/>\n<table>\n<thead>\n<tr>\n<th>s<\/th>\n<th>result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>\"one4seveneight\"<\/code><\/td>\n<td>1478<\/td>\n<\/tr>\n<tr>\n<td><code>\"23four5six7\"<\/code><\/td>\n<td>234567<\/td>\n<\/tr>\n<tr>\n<td><code>\"2three45sixseven\"<\/code><\/td>\n<td>234567<\/td>\n<\/tr>\n<tr>\n<td><code>\"123\"<\/code><\/td>\n<td>123<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uc22b\uc790\uc758 \uc77c\ubd80 \uc790\ub9bf\uc218\ub97c \uc601\ub2e8\uc5b4\ub85c \ubc14\uafb8\ub294 \uc608\uc2dc<\/p>\n<ul>\n<li>1478 \u2192 \"one4seveneight\"<\/li>\n<li>234567 \u2192 \"23four5six7\"<\/li>\n<\/ul>\n<h2>\ud83d\udcab \ucf54\ub4dc<\/h2>\n<pre><code class=\"language-python line-numbers\">def solution(s):\n    dic = {\n        0: \"zero\",\n        1: \"one\",\n        2: \"two\",\n        3: \"three\",\n        4: \"four\",\n        5: \"five\",\n        6: \"six\",\n        7: \"seven\",\n        8: \"eight\",\n        9: \"nine\",\n    }\n    arr = []\n\n    for i in range(10):\n        if str(i) in s:\n            for j in range(s.count(str(i))):\n                arr.append([s.find(str(i)), str(i)])\n                s = s.replace(str(i), 'X', 1)\n        if dic[i] in s:\n            for j in range(s.count(dic[i])):\n                arr.append([s.find(dic[i]), str(i)])\n                s = s[:s.find(dic[i])] + \"X\" * len(dic[i]) + s[s.find(dic[i]) + len(dic[i]):]\n\n    arr.sort(key=lambda x:x[0])\n    a, b = zip(*arr)\n\n    return int(''.join(b))\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udc332021 \uce74\uce74\uc624 \ucc44\uc6a9\uc5f0\uacc4\ud615 \uc778\ud134\uc2ed \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 \ucf54\ub529 \ud14c\uc2a4\ud2b8 \ubb38\uc81c\ub97c \ud480\uace0 \uc815\ub9ac\ud55c \uae00\uc785\ub2c8\ub2e4 \ud83d\udc33 \ud83d\udcab \ubb38\uc81c \uc124\uba85 \ub9e4\uac1c\ubcc0\uc218 s : \uc22b\uc790\uc758 \uc77c\ubd80 \uc790\ub9bf\uc218\uac00 \uc601\ub2e8\uc5b4\ub85c \ubc14\ub00c\uc5b4\uc84c\uac70\ub098, \ud639\uc740 \ubc14\ub00c\uc9c0 \uc54a\uace0 \uadf8\ub300\ub85c\uc778 \ubb38\uc790\uc5f4 1 \u2264\u00a0s\uc758 \uae38\uc774 \u2264 50 s\uac00 &#8220;zero&#8221; \ub610\ub294 &#8220;0&#8221;\uc73c\ub85c \uc2dc\uc791\ud558\ub294 \uacbd\uc6b0\ub294 \uc8fc\uc5b4\uc9c0\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. return \uac12\uc774 1 \uc774\uc0c1 2,000,000,000 \uc774\ud558\uc758 \uc815\uc218\uac00 \ub418\ub294 \uc62c\ubc14\ub978 \uc785\ub825\ub9cc\u00a0s\ub85c \uc8fc\uc5b4\uc9d1\ub2c8\ub2e4. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59,60],"tags":[26,69,11,42,10],"class_list":["post-1313","post","type-post","status-publish","format-standard","hentry","category-coding-test","category-programmers","tag-26","tag-coding-test","tag-programmers","tag-python","tag-10"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 - Dozzing World<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.dozzing.kr\/?p=1313\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 - Dozzing World\" \/>\n<meta property=\"og:description\" content=\"\ud83d\udc332021 \uce74\uce74\uc624 \ucc44\uc6a9\uc5f0\uacc4\ud615 \uc778\ud134\uc2ed \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 \ucf54\ub529 \ud14c\uc2a4\ud2b8 \ubb38\uc81c\ub97c \ud480\uace0 \uc815\ub9ac\ud55c \uae00\uc785\ub2c8\ub2e4 \ud83d\udc33 \ud83d\udcab \ubb38\uc81c \uc124\uba85 \ub9e4\uac1c\ubcc0\uc218 s : \uc22b\uc790\uc758 \uc77c\ubd80 \uc790\ub9bf\uc218\uac00 \uc601\ub2e8\uc5b4\ub85c \ubc14\ub00c\uc5b4\uc84c\uac70\ub098, \ud639\uc740 \ubc14\ub00c\uc9c0 \uc54a\uace0 \uadf8\ub300\ub85c\uc778 \ubb38\uc790\uc5f4 1 \u2264\u00a0s\uc758 \uae38\uc774 \u2264 50 s\uac00 &quot;zero&quot; \ub610\ub294 &quot;0&quot;\uc73c\ub85c \uc2dc\uc791\ud558\ub294 \uacbd\uc6b0\ub294 \uc8fc\uc5b4\uc9c0\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. return \uac12\uc774 1 \uc774\uc0c1 2,000,000,000 \uc774\ud558\uc758 \uc815\uc218\uac00 \ub418\ub294 \uc62c\ubc14\ub978 \uc785\ub825\ub9cc\u00a0s\ub85c \uc8fc\uc5b4\uc9d1\ub2c8\ub2e4. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.dozzing.kr\/?p=1313\" \/>\n<meta property=\"og:site_name\" content=\"Dozzing World\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-20T11:27:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-17T06:10:41+00:00\" \/>\n<meta name=\"author\" content=\"Dozzing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dozzing\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.dozzing.kr\/?p=1313\",\"url\":\"https:\/\/blog.dozzing.kr\/?p=1313\",\"name\":\"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 - Dozzing World\",\"isPartOf\":{\"@id\":\"https:\/\/blog.dozzing.kr\/#website\"},\"datePublished\":\"2024-10-20T11:27:17+00:00\",\"dateModified\":\"2026-03-17T06:10:41+00:00\",\"author\":{\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.dozzing.kr\/?p=1313#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.dozzing.kr\/?p=1313\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.dozzing.kr\/?p=1313#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.dozzing.kr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.dozzing.kr\/#website\",\"url\":\"https:\/\/blog.dozzing.kr\/\",\"name\":\"Dozzing World\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.dozzing.kr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f\",\"name\":\"Dozzing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/blog.dozzing.kr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g\",\"caption\":\"Dozzing\"},\"sameAs\":[\"https:\/\/blog.dozzing.kr\/\"],\"url\":\"https:\/\/blog.dozzing.kr\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 - Dozzing World","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.dozzing.kr\/?p=1313","og_locale":"ko_KR","og_type":"article","og_title":"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 - Dozzing World","og_description":"\ud83d\udc332021 \uce74\uce74\uc624 \ucc44\uc6a9\uc5f0\uacc4\ud615 \uc778\ud134\uc2ed \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 \ucf54\ub529 \ud14c\uc2a4\ud2b8 \ubb38\uc81c\ub97c \ud480\uace0 \uc815\ub9ac\ud55c \uae00\uc785\ub2c8\ub2e4 \ud83d\udc33 \ud83d\udcab \ubb38\uc81c \uc124\uba85 \ub9e4\uac1c\ubcc0\uc218 s : \uc22b\uc790\uc758 \uc77c\ubd80 \uc790\ub9bf\uc218\uac00 \uc601\ub2e8\uc5b4\ub85c \ubc14\ub00c\uc5b4\uc84c\uac70\ub098, \ud639\uc740 \ubc14\ub00c\uc9c0 \uc54a\uace0 \uadf8\ub300\ub85c\uc778 \ubb38\uc790\uc5f4 1 \u2264\u00a0s\uc758 \uae38\uc774 \u2264 50 s\uac00 \"zero\" \ub610\ub294 \"0\"\uc73c\ub85c \uc2dc\uc791\ud558\ub294 \uacbd\uc6b0\ub294 \uc8fc\uc5b4\uc9c0\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. return \uac12\uc774 1 \uc774\uc0c1 2,000,000,000 \uc774\ud558\uc758 \uc815\uc218\uac00 \ub418\ub294 \uc62c\ubc14\ub978 \uc785\ub825\ub9cc\u00a0s\ub85c \uc8fc\uc5b4\uc9d1\ub2c8\ub2e4. [&hellip;]","og_url":"https:\/\/blog.dozzing.kr\/?p=1313","og_site_name":"Dozzing World","article_published_time":"2024-10-20T11:27:17+00:00","article_modified_time":"2026-03-17T06:10:41+00:00","author":"Dozzing","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"Dozzing","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.dozzing.kr\/?p=1313","url":"https:\/\/blog.dozzing.kr\/?p=1313","name":"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50 - Dozzing World","isPartOf":{"@id":"https:\/\/blog.dozzing.kr\/#website"},"datePublished":"2024-10-20T11:27:17+00:00","dateModified":"2026-03-17T06:10:41+00:00","author":{"@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f"},"breadcrumb":{"@id":"https:\/\/blog.dozzing.kr\/?p=1313#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.dozzing.kr\/?p=1313"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.dozzing.kr\/?p=1313#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.dozzing.kr\/"},{"@type":"ListItem","position":2,"name":"[Coding Test] \uc22b\uc790 \ubb38\uc790\uc5f4\uacfc \uc601\ub2e8\uc5b4 \u2b50"}]},{"@type":"WebSite","@id":"https:\/\/blog.dozzing.kr\/#website","url":"https:\/\/blog.dozzing.kr\/","name":"Dozzing World","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.dozzing.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/52258baef65b530d3e867e4c1f79c36f","name":"Dozzing","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/blog.dozzing.kr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0bbe3fe675c3641965411ffb61a1368b3bf05e794deaa3c7bd0ef7b4690a614a?s=96&d=mm&r=g","caption":"Dozzing"},"sameAs":["https:\/\/blog.dozzing.kr\/"],"url":"https:\/\/blog.dozzing.kr\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/1313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1313"}],"version-history":[{"count":2,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/1313\/revisions"}],"predecessor-version":[{"id":1315,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=\/wp\/v2\/posts\/1313\/revisions\/1315"}],"wp:attachment":[{"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.dozzing.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}