전체 글 (283) 썸네일형 리스트형 최대값과 최소값 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import java.util.*; class Solution { public String solution(String s) { String answer = " "; String[] sArr = s.split(" "); //문자열 쪼개기 List list = new ArrayList(); String isMinus = ""; for(int i =0; i 알아두면 좋은거 반복문 Label : for break label; 로 label 붙인 break 실행 가능 소수 찾기 처음에 생각이 안나서 일단 원시적으로 해봤다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 class Solution { public int solution(int n) { int answer = 0; int count =0; for(int i = 2 ; i Collection 나누어 떨어지는 수 1234567891011121314151617181920212223242526272829import java.util.*;class Solution { public int[] answer(List list){ int count =0; if(list.isEmpty()){ int[] answer={-1}; return answer; }else{ int[] answer = new int[list.size()]; for(int i : list){ answer[count] =list.get(count); count++; } Arrays.sort(answer); return answer; } } public int[] solution(int[] arr, int divisor) { List list = new Arr.. 어린 동물 찾기 sql로 할때 SELECT animal_id,name FROM animal_ins WHERE intake_condition 'aged' ORDER BY animal_id 혹은 SELECT animal_id,name FROM animal_ins WHERE intake_condition !='aged' ORDER BY animal_id oracle로 할 때 SELECT animal_id,name FROM animal_ins WHERE intake_condition !='Aged' ORDER BY animal_id 비밀지도 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 class Solution { public String[] solution(int n, int[] arr1, int[] arr2) { int arrLength = arr1.length; String[] answer = new String[arrLength]; int[] arrBitSum = new int[arrLength]; for(int i = 0; i0){ String s=""; for(int i =0; i 알아 두면 좋은것1 -연산자 편 int a= 10; int b =~a; //== -11 int c =~a +1 //==10 a++ 과 ++a int a = ++a // a에 대입할때 11 int a =a++ // a에 대입할때 10 char c1 = 'a'; char c2 = 'a'+1; 리터럴 끼리의 연산은 괜찮음 char c3 = c2 +1 은 안된다. 비트 연산자에서 >> 는 부호결정 비트를 제외하고 민다. >>>는 부호결정 비트 포함해서 민다. 이전 1 ··· 26 27 28 29 30 31 32 ··· 36 다음