ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๊ฒŒ์ž„ ๋งต
ยท
Algorithm/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค
https://programmers.co.kr/learn/courses/30/lessons/1844 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ๊ฒŒ์ž„ ๋งต ์ตœ๋‹จ๊ฑฐ๋ฆฌ [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,1],[0,0,0,0,1]] 11 [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,0],[0,0,0,0,1]] -1 programmers.co.kr ๊ทธ๋ž˜ํ”„ ํƒ์ƒ‰ ๋ฌธ์ œ์ด๋‹ค. ์˜ˆ์ „์— ํ’€์—ˆ๋˜ ๋ฐฑ์ค€ ํ† ๋งˆํ†  ๋ฌธ์ œ(https://www.acmicpc.net/problem/7576)์™€ ๋น„์Šทํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ Queue๋ฅผ ์‚ฌ์šฉํ•œ BFS ์•Œ๊ณ ๋ฆฌ์ฆ˜์œผ๋กœ ํ’€์—ˆ๋‹ค. Player ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค์–ด ์ขŒํ‘œ ๊ฐ’๊ณผ ์ด๋™ํ•œ ์นธ ์ˆ˜๋ฅผ ์ €์žฅํ•˜๋„๋ก ํ–ˆ๋‹ค. ์ฝ”๋“œ import java.util.*; c..
SQL - HAVING
ยท
DB/SQL
https://programmers.co.kr/learn/courses/30/lessons/59041 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ๋™๋ช… ๋™๋ฌผ ์ˆ˜ ์ฐพ๊ธฐ ANIMAL_INS ํ…Œ์ด๋ธ”์€ ๋™๋ฌผ ๋ณดํ˜ธ์†Œ์— ๋“ค์–ด์˜จ ๋™๋ฌผ์˜ ์ •๋ณด๋ฅผ ๋‹ด์€ ํ…Œ์ด๋ธ”์ž…๋‹ˆ๋‹ค. ANIMAL_INS ํ…Œ์ด๋ธ” ๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์œผ๋ฉฐ, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE๋Š” ๊ฐ๊ฐ ๋™๋ฌผ์˜ ์•„์ด๋”” programmers.co.kr oracle SELECT NAME, COUNT(NAME) FROM ANIMAL_INS GROUP BY NAME HAVING COUNT(NAME) >= 2 ORDER BY NAME https://programmers.co.kr/learn/courses/..
SQL - ์ง‘๊ณ„ ํ•จ์ˆ˜
ยท
DB/SQL
MAX() MIN() COUNT() & DISTINCT DISTINCT : ์ค‘๋ณต๊ฐ’ ์ œ์™ธํ•˜๊ณ  ์นด์šดํŠธ ์œ ์˜ํ•  ์  - DISTINCT ์œ„์น˜ --์ด๋ฆ„์˜ ์ค‘๋ณต์„ ๋จผ์ € ์ œ๊ฑฐํ•œ๋’ค, ๊ฐฏ์ˆ˜๋ฅผ ์…ˆ SELECT COUNT(DISTINCT NAME) FROM ANIMAL_INS --์ด๋ฆ„์˜ ๊ฐฏ์ˆ˜๋ฅผ ์ค‘๋ณต์ œ๊ฑฐํ•˜๋Š” ํ–‰์œ„ SELECT DISTINCT COUNT(NAME) FROM ANIMAL_INS + count ํ•จ์ˆ˜๋Š” NULL์„ ์„ธ์ง€ ์•Š๊ธฐ ๋–„๋ฌธ์—, ๊ตณ์ด WHERE NAME IS NOT NULL์„ ์“ฐ์ง€ ์•Š์•„๋„ ๋œ๋‹ค. SUM() AVG()
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค SQL - ์ƒ์œ„ n๊ฐœ ๋ ˆ์ฝ”๋“œ
ยท
DB/SQL
https://programmers.co.kr/learn/courses/30/lessons/59405 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ์ƒ์œ„ n๊ฐœ ๋ ˆ์ฝ”๋“œ ANIMAL_INS ํ…Œ์ด๋ธ”์€ ๋™๋ฌผ ๋ณดํ˜ธ์†Œ์— ๋“ค์–ด์˜จ ๋™๋ฌผ์˜ ์ •๋ณด๋ฅผ ๋‹ด์€ ํ…Œ์ด๋ธ”์ž…๋‹ˆ๋‹ค. ANIMAL_INS ํ…Œ์ด๋ธ” ๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์œผ๋ฉฐ, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE๋Š” ๊ฐ๊ฐ ๋™๋ฌผ์˜ ์•„์ด๋”” programmers.co.kr Oracle์—์„œ ์ƒ์œ„ n๊ฐœ ๋ ˆ์ฝ”๋“œ๋งŒ ๊ฐ€์ ธ์˜ค๋Š” ์ฟผ๋ฆฌ๊ฐ€ ์ƒ๊ฐ์ด ๋‚˜์งˆ ์•Š์•˜๋‹ค. FROM ์—์„œ ์„œ๋ธŒ์ฟผ๋ฆฌ๋ฅผ ์จ์•ผ ํ–ˆ์—ˆ๋„ค.. Oracle์ด ์ต์ˆ™ํ•˜๊ธด ํ•œ๋ฐ, MySQL์ด ๋” ๊ฐ„๋‹จํ•ด๋ณด์ธ๋‹ค. Oracle WHERE rownum = n SELECT NAME FROM (S..
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ๋” ๋งต๊ฒŒ
ยท
Algorithm/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค
https://programmers.co.kr/learn/courses/30/lessons/42626 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ๋” ๋งต๊ฒŒ ๋งค์šด ๊ฒƒ์„ ์ข‹์•„ํ•˜๋Š” Leo๋Š” ๋ชจ๋“  ์Œ์‹์˜ ์Šค์ฝ”๋นŒ ์ง€์ˆ˜๋ฅผ K ์ด์ƒ์œผ๋กœ ๋งŒ๋“ค๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  ์Œ์‹์˜ ์Šค์ฝ”๋นŒ ์ง€์ˆ˜๋ฅผ K ์ด์ƒ์œผ๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด Leo๋Š” ์Šค์ฝ”๋นŒ ์ง€์ˆ˜๊ฐ€ ๊ฐ€์žฅ ๋‚ฎ์€ ๋‘ ๊ฐœ์˜ ์Œ์‹์„ ์•„๋ž˜์™€ ๊ฐ™ programmers.co.kr ์šฐ์„ ์ˆœ์œ„ํ๊ฐ€ ํž™์„ ์ด์šฉํ•ด์„œ ๊ตฌํ˜„์„ ํ•œ๋‹ค๊ณ  ํ•œ๋‹ค. ์›์†Œ๋ฅผ ์ถ”๊ฐ€ํ•  ๋•Œ๋งˆ๋‹ค ๊ฐ’์„ ์ •๋ ฌ์„ ํ•ด์ค€๋‹ค. ์ด ๋ฌธ์ œ๋Š” ์šฐ์„ ์ˆœ์œ„ํ๋ฅผ ์จ์•ผ ํšจ์œจ์„ฑ ํ…Œ์ŠคํŠธ๋ฅผ ํ†ต๊ณผํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ํ•œ๋‹ค. ์ฝ”๋“œ import java.util.*; class Solution { public int solution(int[] scoville, int K) { PriorityQueue pq = ne..
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ์˜์–ด ๋๋ง์ž‡๊ธฐ
ยท
Algorithm/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค
https://programmers.co.kr/learn/courses/30/lessons/12981 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ์˜์–ด ๋๋ง์ž‡๊ธฐ 3 ["tank", "kick", "know", "wheel", "land", "dream", "mother", "robot", "tank"] [3,3] 5 ["hello", "observe", "effect", "take", "either", "recognize", "encourage", "ensure", "establish", "hang", "gather", "refer", "reference", "estimate", "executive"] [0,0] programmers.co.kr ๋ฌธ์ž์—ด์„ ๋‹ค๋ฃจ๋Š” ๋ฌธ์ œ์ด๋‹ค. ๋ฌธ์ž์—ด์—์„œ ๋ฌธ์ž๋ฅผ ๋ฝ‘์•„๋‚ด๊ธฐ ์œ„ํ•ด์„œ str.charAt(i)..
giraffe_
'๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (21 Page)