728x90 Language/Java144 [Programmers | Java | 월간 코드 챌린지 시즌2 문제 풀이] 약수의 개수와 덧셈 - Solution with Counting KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA➗ 약수의 개수와 덧셈 🏷 관련 주제 : Counting Operator ✔️ Solution with Counting in Arrayclass Solution { public int solution(int left, int right) { int answer = 0; int[] cnt = new int[right - left + 1]; for (int i = 1; i = left && n 채점 결과 ✔️ Solution with Counting & Loopclass Solution { public int solution(int left, int .. 2024. 6. 28. [Programmers | Java | 월간 코드 챌린지 시즌1 문제 풀이] 내적 - Solution with Loop & Operator 또는 Stream API KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA📐 내적 🏷 관련 주제 : Array Math Inner Product✔ Solution with Loop & Operatorclass Solution { public int solution(int[] a, int[] b) { int answer = 0; for (int i = 0; i 채점 결과✔ Solution with Stream APIimport java.util.stream.IntStream;class Solution { public int solution(int[] a, int[] b) { int answer = IntStream.rang.. 2024. 6. 27. [Programmers | Java | 연습문제 풀이] 수박수박수박수박수박수? - Solution with repeat() & 문자열 합치기 KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA🍉 수박수박수박수박수박수?🏷 관련 주제 : String repeat() 문자열 합치기 ✔ Solution with repeat() & 덧셈 연산자class Solution { public String solution(int n) { String answer = "수박".repeat(n / 2); if (n % 2 == 1) { answer += "수"; } return answer; }}채점 결과✔ Solution with Stream APIimport java.util.stream.IntStream;.. 2024. 6. 26. [Programmers | Java | 연습문제 풀이] 가운데 글자 가져오기 - Solution with substring KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA🅰️ 가운데 글자 가져오기 🏷 관련 주제 : String index substring✔ Solution with substringclass Solution { public String solution(String s) { int len = s.length(); int idx1; int idx2; if (len % 2 == 0) { idx1 = len / 2 - 1; idx2 = idx1 + 2; } else { idx1 = len / 2; idx2 = .. 2024. 6. 25. [Programmers | Java | 연습문제 풀이] 제일 작은 수 제거하기 - Solution with Array 또는 arraycopy 또는 Stream API KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA🔢 제일 작은 수 제거하기 🏷 관련 주제 : 정렬 Array ✔ Solution with Loopimport java.util.Arrays;class Solution { public int[] solution(int[] arr) { int[] answer; int len = arr.length; if (len == 1) { answer = new int[]{-1}; return answer; } int[] copyArr = arr.clone(); .. 2024. 6. 24. [LeetCode | Java | Queue 문제 풀이] 933. Number of Recent Calls - Solution with ArrayList & Stream API 99 Club 2기 | Java | Beginner🤙 Number of Recent Calls🏷 관련 주제 : Design Queue Data StreamEasy ✔ Solution with ArrayList & Stream APIimport java.util.ArrayList;class RecentCounter { ArrayList recentCounter; public RecentCounter() { recentCounter = new ArrayList(); } public int ping(int t) { recentCounter.add(t); int answer = (int) recentCounter.stream().f.. 2024. 6. 23. [Programmers | Java | 월간 코드 챌린지 시즌3 문제 풀이] 없는 숫자 더하기 - Solution with Subtraction KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA➕ 없는 숫자 더하기🏷 관련 주제 : Array Loop Operator Stream API✔ Solution with Loop & Additionimport java.util.Arrays;class Solution { public int solution(int[] numbers) { int answer = 0; int idx = 0; int n = -1; Arrays.sort(numbers); for (int i = 0; i 채점 결과✔ Solution with Loop & Subtraction (🚀가장 빠.. 2024. 6. 23. [Programmers | Java | 연습문제 풀이] 핸드폰 번호 가리기 - Solution with String.format() & repeat() & substring() KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA📱핸드폰 번호 가리기🏷 관련 주제 : String format() repeat() substring() length()✔ Solution with String.format() & repeat() & substring()class Solution { public String solution(String phone_number) { int len = phone_number.length(); String answer = String.format("%s%s", "*".repeat(len - 4), phone_number.substring(len - 4, len)); .. 2024. 6. 23. [LeetCode | Java | Array, Stack, Queue 문제 풀이] 1700. Number of Students Unable to Eat Lunch - Solution with Queue 또는 Counting 99 Club 2기 | Java | Beginner🥪 1700. Number of Students Unable to Eat Lunch🏷 관련 주제 : Array Stack Queue SimulationEasy✔ Solution with Queueimport java.util.LinkedList;import java.util.Queue;import java.util.Arrays;import java.util.stream.Collectors;class Solution { public int countStudents(int[] students, int[] sandwiches) { Queue q = new LinkedList(Arrays.stream(students).boxed().coll.. 2024. 6. 22. 이전 1 ··· 4 5 6 7 8 9 10 ··· 16 다음 728x90