목록전체 글 (167)
GaGe
class Solution { public int solution(int n) { int answer = 0; int a=1; int b=1; for(int i = 1 ; i
class Solution { public boolean[] visited; public void dps(int n, int[][] computers, int i ){ visited[i]=true; for(int j =0; j
n = 1 0 n = 2 0 0 1 n = 2 0 0 1 n = 3 0 0 1 0 0 1 1 n = 3 0 0 1 0 0 1 1 n = 4 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 n = 4 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 n = 5 0 0 1 0 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 1 0 0 1 1 0 1 1 전 이런 식으로 패턴을 찾았는데 더 이해하기 쉬운 다른 패턴 찾으신 분은 공유 부탁드려요. 이해가 안 되시는 분은 댓글 남겨주세요. 패턴만 이해하시면 아마 코딩은 쉬울 거예요. import java.util.ArrayList; import java.util.Arrays; class Solution { pub..
import java.util.ArrayList; import java.util.List; class Solution { public int solution(int[] citations) { int answer = 0; List list = new ArrayList(); for( int j = 0 ; j
import java.util.ArrayList; class Solution { public int solution(String s) { int answer = s.length(); for( int i = 1 ; i(result.length()+finword)){ answer=result.length()+finword; } } return answer; } } 뭔가 더 ArrayList를 사용하자는 생각이 든다. import java.util.ArrayList; class Solution { public int solution(String s) { int answer = 0; for( int i = 1 ; i(str.size()+finword)){ answer=str.size()+finword; } re..