๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

Algorithm242

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค[Java] - ๋ฒ ์ŠคํŠธ์•จ๋ฒ”(ํ•ด์‹œ) https://programmers.co.kr/learn/courses/30/lessons/42579 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ๋ฒ ์ŠคํŠธ์•จ๋ฒ” ์ŠคํŠธ๋ฆฌ๋ฐ ์‚ฌ์ดํŠธ์—์„œ ์žฅ๋ฅด ๋ณ„๋กœ ๊ฐ€์žฅ ๋งŽ์ด ์žฌ์ƒ๋œ ๋…ธ๋ž˜๋ฅผ ๋‘ ๊ฐœ์”ฉ ๋ชจ์•„ ๋ฒ ์ŠคํŠธ ์•จ๋ฒ”์„ ์ถœ์‹œํ•˜๋ ค ํ•ฉ๋‹ˆ๋‹ค. ๋…ธ๋ž˜๋Š” ๊ณ ์œ  ๋ฒˆํ˜ธ๋กœ ๊ตฌ๋ถ„ํ•˜๋ฉฐ, ๋…ธ๋ž˜๋ฅผ ์ˆ˜๋กํ•˜๋Š” ๊ธฐ์ค€์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์†ํ•œ ๋…ธ๋ž˜๊ฐ€ programmers.co.kr ํ‹€๋ฆฐ ์ฝ”๋“œ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; class Solution { public static int[] solution(String[] genres, int[] pla.. 2021. 6. 4.
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค[Java] - H-Index(์ •๋ ฌ) programmers.co.kr/learn/courses/30/lessons/42747 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - H-Index H-Index๋Š” ๊ณผํ•™์ž์˜ ์ƒ์‚ฐ์„ฑ๊ณผ ์˜ํ–ฅ๋ ฅ์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ง€ํ‘œ์ž…๋‹ˆ๋‹ค. ์–ด๋Š ๊ณผํ•™์ž์˜ H-Index๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฐ’์ธ h๋ฅผ ๊ตฌํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์œ„ํ‚ค๋ฐฑ๊ณผ1์— ๋”ฐ๋ฅด๋ฉด, H-Index๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ตฌํ•ฉ๋‹ˆ๋‹ค. ์–ด๋–ค ๊ณผํ•™์ž๊ฐ€ ๋ฐœํ‘œ programmers.co.kr ์ฝ”๋“œ import java.util.Arrays; class Solution { public int solution(int[] citations) { int answer = 0; int size = citations.length; Arrays.sort(citations); int max = max(citations); for (int i = 0.. 2020. 12. 5.
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค[Java] - ํ‚คํŒจ๋“œ ๋ˆ„๋ฅด๊ธฐ(2020 ์นด์นด์˜ค ์ธํ„ด์‹ญ) programmers.co.kr/learn/courses/30/lessons/67256 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ํ‚คํŒจ๋“œ ๋ˆ„๋ฅด๊ธฐ [1, 3, 4, 5, 8, 2, 1, 4, 5, 9, 5] "right" "LRLLLRLLRRL" [7, 0, 8, 2, 8, 3, 1, 5, 7, 6, 2] "left" "LRLLRRLLLRR" [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] "right" "LLRLLRLLRL" programmers.co.kr ์ฝ”๋“œ class Solution { public static String solution(int[] numbers, String hand) { StringBuilder sb = new StringBuilder(); int leftIndex = 10; // '*' =>.. 2020. 10. 3.
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค[Java] - ์‚ผ๊ฐ ๋‹ฌํŒฝ์ด programmers.co.kr/learn/courses/30/lessons/68645 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ์‚ผ๊ฐ ๋‹ฌํŒฝ์ด 5 [1,2,12,3,13,11,4,14,15,10,5,6,7,8,9] 6 [1,2,15,3,16,14,4,17,21,13,5,18,19,20,12,6,7,8,9,10,11] programmers.co.kr ์ฝ”๋“œ class Solution { public static int[] solution(int n) { if(n == 1) { return new int[] {1}; } int answerLen = 3; for(int i=3; i 2020. 9. 26.
[Programmers] - ๋‘ ๊ฐœ ๋ฝ‘์•„์„œ ๋”ํ•˜๊ธฐ programmers.co.kr/learn/courses/30/lessons/68644 ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต - ๋‘ ๊ฐœ ๋ฝ‘์•„์„œ ๋”ํ•˜๊ธฐ programmers.co.kr ์ฝ”๋“œ import java.util.*; class Solution { public static int[] solution(int[] numbers) { int numbersLen = numbers.length; Set hashSet = new HashSet(); for(int i=0; i 2020. 9. 20.
[SW Expert Academy] - (D2)1974. ์Šค๋„์ฟ  ๊ฒ€์ฆ https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Psz16AYEDFAUq&categoryId=AV5Psz16AYEDFAUq&categoryType=CODE SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ์ฝ”๋“œ import java.util.Scanner; public class Solution { static int map[][]; static boolean flag[]; /* ํ–‰(๊ฐ€๋กœ) ์ฒดํฌ */ public static boolean checkRow(int i) { flag = new boolean[9]; for(.. 2020. 8. 10.
[SW Expert Academy] - (D1)1933. ๊ฐ„๋‹จํ•œ N์˜ ์•ฝ์ˆ˜(Stream) https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PhcWaAKIDFAUq&categoryId=AV5PhcWaAKIDFAUq&categoryType=CODE SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ์ฝ”๋“œ import java.util.Scanner; import java.util.stream.IntStream; public class ๊ฐ„๋‹จํ•œN์˜์•ฝ์ˆ˜_1933 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N .. 2020. 8. 9.
[SW Expert Academy] - (D1)2019. ๋”๋ธ”๋”๋ธ”(Stream) https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QDEX6AqwDFAUq&categoryId=AV5QDEX6AqwDFAUq&categoryType=CODE SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ์ฝ”๋“œ import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt.. 2020. 8. 8.
[SW Expert Academy] - (D1)2071. ํ‰๊ท ๊ฐ’ ๊ตฌํ•˜๊ธฐ(Stream) https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QRnJqA5cDFAUq&categoryId=AV5QRnJqA5cDFAUq&categoryType=CODE SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com ์ฝ”๋“œ import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int T = scan.nextInt.. 2020. 8. 6.
[SW Expert Academy] - (D1)2072. ํ™€์ˆ˜๋งŒ ๋”ํ•˜๊ธฐ(Stream) https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QSEhaA5sDFAUq&categoryId=AV5QSEhaA5sDFAUq&categoryType=CODE SW Expert Academy SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”! swexpertacademy.com Q) 10๊ฐœ์˜ ์ˆ˜๋ฅผ ์ž…๋ ฅ๋ฐ›์•„ ๊ทธ ์ค‘์—์„œ ํ™€์ˆ˜๋งŒ ๋”ํ•œ ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋ผ. ์ฝ”๋“œ import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner scan = new Sc.. 2020. 8. 5.
๋ฐ˜์‘ํ˜•