[프로그래머스/Java] Lv.0 종이 자르기 문제 풀이 1 2 3 4 5 6 7 8 class Solution { public int solution(int M, int N) { int l=M-1; int w=(N-1)*M; return l+w; } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2023. 1. 3. 14:02
[프로그래머스/Java] Lv.0 문자열 밀기 문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 class Solution { public int solution(String A, String B) { int answer=0; String str=A; for(int i=0; i [JAVA] 프로그래머스 스쿨/Java Lv.0 2023. 1. 2. 15:00
[프로그래머스/Java] Lv.0 잘라서 배열로 저장하기 문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class Solution { public String[] solution(String my_str, int n) { int length=(int) Math.ceil((double)my_str.length()/n); //my_str을 n으로 나누고 올림해서 int에 저장함 String[] answer=new String[length]; //길이가 length인 answer배열 int index=0; for(int i=0; i [JAVA] 프로그래머스 스쿨/Java Lv.0 2023. 1. 2. 14:34
[프로그래머스/Java] Lv.0 7의 개수 문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution { public int solution(int[] array) { int answer = 0; for(int i=0; i [JAVA] 프로그래머스 스쿨/Java Lv.0 2023. 1. 2. 14:16
[프로그래머스/Java] Lv.0 문자열 정렬하기 (2) 문제 풀이 1 2 3 4 5 6 7 8 9 10 import java.util.Arrays; class Solution { public String solution(String my_string) { String lower=my_string.toLowerCase(); char[] arr=lower.toCharArray(); Arrays.sort(arr); return new String(arr); } } Colored by Color Scripter cs [JAVA] 프로그래머스 스쿨/Java Lv.0 2023. 1. 2. 00:16
[프로그래머스/SQL] SELECT 여러 기준으로 정렬하기 문제 설명 풀이 1 2 3 SELECT animal_id, name, datetime from animal_ins order by name asc, datetime desc; cs [SQL] 프로그래머스 스쿨/SELECT 2022. 12. 31. 22:43
[프로그래머스/SQL] SELECT 상위 n개 레코드 문제 설명 풀이 1 2 3 4 5 6 select name from animal_ins where datetime=( select min(datetime) from animal_ins ); cs [SQL] 프로그래머스 스쿨/SELECT 2022. 12. 31. 22:40
[프로그래머스/SQL] SELECT 조건에 맞는 회원수 구하기 문제 설명 문제 풀이 1 2 3 SELECT count(*) from user_info where substr(joined, 1, 4)='2021' and age>=20 and age [SQL] 프로그래머스 스쿨/SELECT 2022. 12. 31. 22:33