Git clone a repo to another repo
1. 클론하기 // git clone --bare {repo to clone} git clone --bare https://github.com/soheeparklee/soheeparklee.github.io.git 2. 여기에 // find file cd soheeparklee.github.io.git 3. mirror push /...
1. 클론하기 // git clone --bare {repo to clone} git clone --bare https://github.com/soheeparklee/soheeparklee.github.io.git 2. 여기에 // find file cd soheeparklee.github.io.git 3. mirror push /...
✅ 0이면 0점, 1이면 1점으로 계산하되, 연속된 1이면 두 번째 1은 2점, 3번째 1은 3점 등으로 가산점을 줍니다. 예를 들어, 1 0 1 1 1 0 0 1 1 0 이면 가산점은, 1 0 1 2 3 0 0 1 2 0 이라서 최종 점수는 10점이 됩니다. class Main { public int solution(int n, int...
✅ n개의 자연수가 입력되면 그 자연수들을 뒤집는다. 이후 그 뒤집은 자연수가 소수인지 판별하여 소수이면 출력한다. 예를 들어 32를 뒤집으면 23이고 23은 소수이므로 출력 190은 뒤집으면 091이므로 91이 된다. 첫 자리부터 연속된 0은 무시한다. 1은 소수가 아니다. class Main { public boolean isP...
✅ 아리스토테네스 체 class Main { public int solution(int n){ int answer = 0; int[] intArr= new int[n+1]; //처음 빈 배열 생성되면 모든 값은 0 for(int i=2; i<n; i++){ if(intArr[i] == 0){ ...
✅ 피보나치 수열: 앞 두 수를 합하여 다음 수가 되는 수열 class Main { public int[] solution(int n){ int[] answer= new int[n]; answer[0] = 1; answer[1] = 1; for(int i=2; i<...
✅ 1: 가위, 2: 바위, 3: 보 일 때 이긴 사람 출력하기 첫 줄은 몇 번 가위바위보 했는지 둘째 줄은 A가 낸 손 셋째 줄은 B가 낸 손 class Main { public String solution(int n, int[] arrayA, int[] arrayB){ String answer= ""; f...
✅ 내 앞에 있는 숫자들보다 내가 제일 크면 출력 작거나 같아도 보이지 않습니다. 2중 for문을 만들 필요 없이 그냥 최대값이랑 비교하면 된다. class Main { public int solution(int n, int[] arr){ int answer=1; int max=arr[0]; f...
✅ N개의 정수를 입력받아, 자기 바로 앞의 수보다 자신이 크면 출력하는 프로그램 단, 첫 번째 수는 무조건 출력한다. class Main { public ArrayList<Integer> solution(int n, int[] arr){ ArrayList<Integer> answer= new Array...
✅ #*이 7개로 구성되어 있을 때, #는 1로, *은 0으로 반환하고 이진수를 십진수로 바꿔서 대문자 알파벳으로 출력해라 한 줄로 받은 String을 7개씩 s개의 String으로 나눈다. #은 1, *은 0으로 대체한다. 이진수를 십진수로 바꾼다. 십진수는 알파벳으로 캐스팅한다. class Main { public St...
✅ 알파벳 대문자로 이루어진 문자열을 입력받아 같은 문자가 연속으로 반복되는 경우 반복되는 문자 바로 오른쪽에 반복 횟수를 표기 단 반복횟수가 1인 경우 생략합니다. 맨 마지막 인덱스가 없으면 에러나니까 미리 str에 빈 문자를 맨 마지막에 추가해두고 시작한다. class Main { public String solution(Strin...