분류 전체보기 190

[프로그래머스] 가장 가까운 같은 글자 JAVA

문제[프로그래머스] 가장 가까운 같은 글자 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public int[] solution(String s) { int[] answer = new int[s.length()]; String alpha = ""; for(int i = 0; i = 0; j--) { String a = "" + s.charAt(j); if (one.equals(a)..

[프로그래머스] 푸드 파이트 대회 JAVA

문제[프로그래머스] 푸드 파이트 대회  프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public String solution(int[] food) { String answer = ""; List arr = new ArrayList(); for(int i = 1; i =0; i--) { answer += arr.get(i); } return answer; }}앞 부분과 뒤 부분이 같이..

[프로그래머스] 콜라 문제 JAVA

문제[프로그래머스] 콜라 문제 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답class Solution { public int solution(int a, int b, int n) { int answer = 0; while(n >= a) { answer += (n / a)*b; n = n % a + (n / a)*b; } return answer; }}

[프로그래머스] 명예의 전당 (1) JAVA

문제[프로그래머스] 명예의 전당 (1) 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public int[] solution(int k, int[] score) { int[] answer = new int[score.length]; List arr = new ArrayList(); for(int i = 0; i min) { arr.remove(0); arr.add(score[i]..

[프로그래머스] 2016년 JAVA

문제[프로그래머스] 2016년 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public String solution(int a, int b) { String answer = ""; Map month = new HashMap(); Map date = new HashMap(); month.put(1, 31); month.put(2, 29); month.put(3, 31); month.p..

[프로그래머스] K번째수 JAVA

제목[프로그래머스] K번째수 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public int[] solution(int[] array, int[][] commands) { int[] answer = new int[commands.length]; ArrayList nums = new ArrayList(); for (int arr : array) { nums.add(arr); } ..

[프로그래머스] 두 개 뽑아서 더하기 JAVA

문제[프로그래머스] 두 개 뽑아서 더하기 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public int[] solution(int[] numbers) { int[] answer; List nums = new ArrayList(); List result = new ArrayList(); Set hash; for(int number : numbers) { nums.add(number); ..

20240731_TIL

1. 내일배움캠프 Java 문법 종합반오늘은 개인 과제를 모두 제출하고 밍글데이를 했습니다. 밍글데이는 이번 과제를 모두 마무리하여 쉬어가는 시간이었습니다. 2. 김영한의 실전 자바 - 기본편  세션 8, 세션9를 듣고 공부하였습니다.  오늘은 중첩클래스, 내부클래스, 익명클래스, 예외처리에 관하여 배웠습니다. 3. 코딩테스트[프로그래머스] 문자열 내 마음대로 정렬하기 JAVA

TIL 2024.08.01

[프로그래머스] 문자열 내 마음대로 정렬하기 JAVA

문제[프로그래머스] 문자열 내 마음대로 정렬하기 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr  정답import java.util.*;class Solution { public String[] solution(String[] strings, int n) { String[] answer = new String[strings.length]; String[] alpha = new String[strings.length]; ArrayList wordList = new ArrayList(); ArrayList a..