์ „์ฒด ๊ธ€

์ „์ฒด ๊ธ€

    [JAVA] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ตœ์†Œ์ง์‚ฌ๊ฐํ˜•

    ~๋ชฉ์ฐจ~ ๋ฌธ์ œ ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ ์ž‘์„ฑ ์ฝ”๋“œ ๋ฌธ์ œ https://school.programmers.co.kr/learn/courses/30/lessons/86491?language=java ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ - ๊ฐ ์ง์‚ฌ๊ฐํ˜•์˜ ๊ฐ’ ์ค‘ ํฐ ๊ฐ’์„ ์˜ค๋ฅธ์ชฝ(์„ธ๋กœ) ๋˜๋Š” ์™ผ์ชฝ(๊ฐ€๋กœ)์œผ๋กœ ๋ชฐ์•„์„œ ์žฌ๋ฐฐ์น˜ํ•œ๋‹ค. - ์žฌ๋ฐฐ์น˜ํ•œ ๊ฐ’์˜ ์„ธ๋กœ ์ค‘ ๊ฐ€์žฅ ํฐ ๊ฐ’๊ณผ ๊ฐ€๋กœ ์ค‘ ๊ฐ€์žฅ ํฐ ๊ฐ’์„ ๊ตฌํ•˜์—ฌ ๊ณฑํ•œ ๊ฐ’์„ ๋ฆฌํ„ด ์ž‘์„ฑ ์ฝ”๋“œ class Solution { public int solution(int[][] sizes) { int answer = ..

    [Python] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ํ‚คํŒจ๋“œ ๋ˆ„๋ฅด๊ธฐ | 2020 ์นด์นด์˜ค ์ธํ„ด์‹ญ

    ~๋ชฉ์ฐจ~ ๋ฌธ์ œ ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ ์ž‘์„ฑ ์ฝ”๋“œ ๋ฌธ์ œ https://school.programmers.co.kr/learn/courses/30/lessons/67256 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ - ๊ฐ ํ‚ค๋ณด๋“œ๋งˆ๋‹ค ๋ฒˆํ˜ธ๋ฅผ ๋ถ€์—ฌ '*', '#' ์€ ๊ฐ๊ฐ 10, 11๋ฒˆ - 1, 4, 7์€ ์™ผ์†์ด 3, 6, 9๋Š” ์˜ค๋ฅธ์†์ด ๊ฒฐ์ •๋ผ์–ด ์žˆ์œผ๋‚˜ 2, 5, 8, 0์€ ์˜ค๋ฅธ์†์ธ์ง€ ์™ผ์†์ธ์ง€ ๊ฒฐ์ •ํ•ด์•ผํ•จ : ๊ทธ๋Ÿฌ๋ฏ€๋กœ 2, 5, 7, 0 ์œผ๋กœ๋ถ€ํ„ฐ ๋‹ค๋ฅธ ํ‚ค๋ณด๋“œ๊นŒ์ง€์˜ ๊ฑฐ๋ฆฌ๋ฅผ ์ €์žฅํ•œ keypad ๋”•์…”๋„ˆ๋ฆฌ ์ž‘์„ฑ - ํ˜„์žฌ ์™ผ์†, ์˜ค๋ฅธ์†์ด ์œ„์น˜ํ•œ ํ‚ค๋ณด๋“œ ์œ„์น˜..

    [JAVA] ๋‹คํ˜•์„ฑ | ์˜ค๋ฒ„๋ผ์ด๋”ฉ vs ์˜ค๋ฒ„๋กœ๋”ฉ | ๋‹ค์šด์บ์ŠคํŒ… vs ์—…์บ์ŠคํŒ…

    ๋ชฉ์ฐจ ๋‹คํ˜•์„ฑ์ด๋ž€? ์˜ค๋ฒ„๋ผ์ด๋”ฉ vs ์˜ค๋ฒ„๋กœ๋”ฉ (๊ฐ์ฒด ์ฐธ์กฐ ๋ณ€์ˆ˜) ํ˜•๋ณ€ํ™˜ ๋‹ค์šด์บ์ŠคํŒ… vs ์—…์บ์ŠคํŒ… ๋‹คํ˜•์„ฑ์ด๋ž€? ๋‹คํ˜•์„ฑ์ด๋ž€, ํ•˜๋‚˜์˜ ๊ฐ์ฒด๊ฐ€ ๋‹ค์–‘ํ•œ ์†์„ฑ์ด๋‚˜ ํ˜•ํƒœ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•œ๋‹ค. ๊ฐ์ฒด์ง€ํ–ฅํ”„๋กœ๊ทธ๋ž˜๋ฐ(OOP, Object-Oriented Programming)์˜ ๋Œ€ํ‘œ์ ์ธ ํŠน์ง• ์ค‘ ํ•˜๋‚˜์ด๋‹ค. ์˜ค๋ฒ„๋ผ์ด๋”ฉ(Overriding), ์˜ค๋ฒ„๋กœ๋”ฉ(Overloading), ๊ฐ์ฒด ์ฐธ์กฐ ๋ณ€์ˆ˜์˜ ํ˜•๋ณ€ํ™˜(Casting)์ด ๋Œ€ํ‘œ์  ์˜ˆ์ด๋‹ค. ์˜ค๋ฒ„๋ผ์ด๋”ฉ vs ์˜ค๋ฒ„๋กœ๋”ฉ (Overriding vs Overloading) ์ด๋ฆ„ ์„ค๋ช… ์˜ˆ์‹œ ์˜ค๋ฒ„๋ผ์ด๋”ฉ(Overriding) ์ž์‹ ํด๋ž˜์Šค์—์„œ ๋ถ€๋ชจ ํด๋ž˜์Šค์˜ ํ•จ์ˆ˜๋ฅผ ์žฌ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ ์˜ค๋ฒ„๋กœ๋”ฉ(Overloading) ๋™์ผํ•œ ์ด๋ฆ„์„ ๊ฐ€์ง„ ํ•จ์ˆ˜๋ฅผ ๋งค๊ฐœ๋ณ€์ˆ˜๋งŒ ๋‹ฌ๋ฆฌํ•˜์—ฌ ์ž‘์„ฑํ•œ ๊ฒƒ ํด๋ž˜์Šค์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋งŒ ๋‹ค๋ฅธ..

    [SWEA] ํŒŒ์ด์ฌ 2814. ์ตœ์žฅ ๊ฒฝ๋กœ | DFS

    ~๋ชฉ์ฐจ~ ๋ฌธ์ œ ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ ์ž‘์„ฑ ์ฝ”๋“œ ๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&contestProbId=AV7GOPPaAeMDFAXB&categoryId=AV7GOPPaAeMDFAXB&categoryType=CODE&problemTitle=&orderBy=RECOMMEND_COUNT&selectCodeLang=PYTHON&select-1=3&pageSize=10&pageIndex=2 SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ - BFS ๋ฌธ์ œ์ธ์ค„ ์•Œ์•˜์œผ๋‚˜ DFS๋กœ ๋ฐ–์— ํ’€ ์ˆ˜ ์—†๋Š” ..

    [SWEA] ํŒŒ์ด์ฌ 1860. ์ง„๊ธฐ์˜ ์ตœ๊ณ ๊ธ‰ ๋ถ•์–ด๋นต

    ~๋ชฉ์ฐจ~ ๋ฌธ์ œ ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ ์ž‘์„ฑ ์ฝ”๋“œ ๋ฌธ์ œ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5LsaaqDzYDFAXc&categoryId=AV5LsaaqDzYDFAXc&categoryType=CODE SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ - ์†๋‹˜์ด ๋จผ์ € ์˜ค๋Š” ์ˆœ์„œ๋กœ ์ •๋ ฌ - ์†๋‹˜์ด ์˜จ ์‹œ๊ฐ„์— ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๋ถ•์–ด๋นต ๊ฐœ์ˆ˜ ๊ตฌํ•˜๊ธฐ - ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๋ถ•์–ด๋นต ๊ฐœ์ˆ˜๊ฐ€ ์†๋‹˜์˜ ์ˆ˜๋ณด๋‹ค ์ ๋‹ค๋ฉด Impossible - ๋ชจ๋“  ์†๋‹˜์˜ ๋„์ฐฉ์‹œ๊ฐ„์˜ ๋งž์ถฐ์„œ ํ•ญ์ƒ ๋ถ•์–ด๋นต์„ ๋งž์ถœ ์ˆ˜ ์žˆ์—ˆ๋‹ค๋ฉด Possible ์ž‘์„ฑ ์ฝ”..

    [JAVA] ์ž…๋ ฅ ๋ฐ›๊ธฐ | Scanner | BufferedReader | StringTokenizer

    Python์œผ๋กœ ์ฝ”๋”ฉํ…Œ์ŠคํŠธ๋ฅผ ์‹œ์ž‘ํ•œ ์ง€ ์–ด์–ธ 4๊ฐœ์›” ์ •๋„ ๋˜์–ด๊ฐ€๋Š” ์ค‘ ์šฐ์•„ํ•œ ํ…Œํฌ ์บ ํ”„(์šฐํ…Œ์ฝ”) 6๊ธฐ๋ฅผ ์œ„ํ•ด์„œ JAVA๋กœ ๊ณต๋ถ€๋ฅผ ์‹œ์ž‘ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค! ํ™•์‹คํžˆ ์ด์ „์— ํฅ๋ฏธ๋กญ๊ฒŒ ๊ณต๋ถ€ํ–ˆ๋˜ ์–ธ์–ด์—ฌ์„œ ๊ทธ๋Ÿฐ์ง€ ์ตํžˆ๋Š” ๋ฐ๋Š” ํฌ๊ฒŒ ๋ฌธ์ œ๊ฐ€ ์—†์—ˆ๋„ค์š” ๋‹ค๋งŒ ์ž…/์ถœ๋ ฅ ๋ฐฉ๋ฒ•์ฒ˜๋Ÿผ ์ •๋ง ๋‹จ์ˆœํ•œ ๊ฒƒ์ด ์ƒ๊ฐ ๋‚˜์ง€ ์•Š์„ ๋•Œ๊ฐ€ ์žˆ๋”๋ผ๊ตฌ์š”ใ…Žใ…Ž ๋‚˜ JAVA ๋ด๋ผ ์ด์ฐธ์— ์ •๋ฆฌํ•ด๋†“์œผ๋ ค ํ•ฉ๋‹ˆ๋‹ค ๋ณธ๊ฒฉ์ ์œผ๋กœ ๊ธ€์„ ์ž‘์„ฑํ•˜๊ธฐ์— ์•ž์„œ์„œ macOS๋ฅผ ์ด์šฉํ•˜์‹œ๋Š” ๋ถ„๋“ค์€ ์ดํด๋ฆฝ์Šค์—์„œ Shipt + Command + O ์ž…๋ ฅ ์‹œ ํ•„์š”ํ•œ ๋ชจ๋“ˆ์ด ์ž๋™์œผ๋กœ ์ถ”๊ฐ€ ๋ฉ๋‹ˆ๋‹ค ~๋ชฉ์ฐจ~ 1. Scanner 1-1. Scanner ๋ฉ”์†Œ๋“œ 2. BufferedReader 2-1. StringTokenizer 1. Scanner JAVA์˜ Scanner ํด๋ž˜์Šค๋ฅผ ์ด์šฉํ•œ ๊ธฐ๋ณธ์ ์ธ ์ž…..