본문 바로가기

Java

(497)
[JAVA] 프로그래머스 - 이상한 문자 만들기 https://school.programmers.co.kr/learn/courses/30/lessons/12930 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr    정답  class Solution { public String solution(String s) { StringBuilder answer = new StringBuilder(); int idx = 0; for(int i=0; i
[JAVA] 프로그래머스 - 같은 숫자는 싫어 https://school.programmers.co.kr/learn/courses/30/lessons/12906 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr    정답  import java.util.*;public class Solution { public int[] solution(int []arr) { Stack stk = new Stack(); for(int i=0; i   다른 사람의 풀이  import java.util.*;public class Solution { public i..
[JAVA] 프로그래머스 - 공원 산책 https://school.programmers.co.kr/learn/courses/30/lessons/172928 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr   시도 import java.util.*;class Solution { public int[] solution(String[] park, String[] routes) { int row_len = park.length; int col_len = park[0].length(); //park 1차원 배열 2차원 배열로 변환..
[JAVA] 프로그래머스 - 행렬의 덧셈 https://school.programmers.co.kr/learn/courses/30/lessons/12950 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr    정답  class Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int row_size = arr1.length; int col_size = arr1[0].length; int[][] answer = new int[row_size][col_size]; ..
[JAVA] 프로그래머스 - 문자열 다루기 기본 https://school.programmers.co.kr/learn/courses/30/lessons/12918 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr    정답   class Solution { public boolean checkDigit(String s) { boolean check = true; char ch[] = s.toCharArray(); for(int i=0; i   다른 사람의 풀이  class Solution { public boolean solution(String s) { ..
[JAVA] 프로그래머스 - 부족한 금액 계산하기 https://school.programmers.co.kr/learn/courses/30/lessons/82612 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr    정답  class Solution { public long solution(int price, int money, int count) { long answer = 0; for(int i=1; i
[JAVA] 프로그래머스 - 내적 https://school.programmers.co.kr/learn/courses/30/lessons/70128 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr    정답  class Solution { public int solution(int[] a, int[] b) { int answer = 0; for(int i=0; i
[JAVA] 프로그래머스 - 약수의 개수와 덧셈 https://school.programmers.co.kr/learn/courses/30/lessons/77884 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr   정답  class Solution { public int count (int n) { int cnt = 0; //약수의 개수 for(int i=1; i  다른 사람의 풀이  class Solution { public int solution(int left, int right) { int answer = 0; for (int i=l..