목록2024/03 (19)
코딩블로그
https://softeer.ai/practice/6247 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai 내가 푼 20점 짜리 코드 import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine())..
https://www.acmicpc.net/problem/1520 1520번: 내리막 길 여행을 떠난 세준이는 지도를 하나 구하였다. 이 지도는 아래 그림과 같이 직사각형 모양이며 여러 칸으로 나뉘어져 있다. 한 칸은 한 지점을 나타내는데 각 칸에는 그 지점의 높이가 쓰여 있으 www.acmicpc.net import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static int M,N; public static int[][] arr; public static int[][] dp; public static int[] dy = {-..
팝콘메이트에서 외부 API와 통신하는 기능이 적지 않다. 카카오와 애플은 이미 FeignClient를 이용하여 구현을 하였는데, 영화 관련 Open Api (영진위,TMDB)는 OKHTTP를 이용하여 사용하고 있다. 이미 FeignClient의 장점을 소개한 바가 있는 만큼 리팩토링을 할 때 꼭 적용해보고 싶은 부분이었다 TMDB 📙TmdbErrorDecoder public class TmdbErrorDecoder implements ErrorDecoder { @Override @SneakyThrows public Exception decode(String methodKey, Response response) { InputStream inputStream = response.body().asInputSt..
내가 작성한 ScreeningController에서 멀티 모듈환경에서 테스트 코드를 짜는 것은 흔하게 구글링 하면 나오는 설정들과 달라서 설정하는게 조금 힘들었다 먼저 전체적인 테스트 코드 환경을 확인해보자 📙ApiIntegrateProfileResolver public class ApiIntegrateProfileResolver implements ActiveProfilesResolver { @Override public String[] resolve(Class testClass) { // some code to find out your active profiles return new String[] {"test","infra","domain","core"}; } } 테스트를 실행하면 어떤 profil..
https://www.acmicpc.net/problem/14716 14716번: 현수막 혁진이의 생각대로 프로그램을 구현했을 때, 현수막에서 글자의 개수가 몇 개인지 출력하여라. www.acmicpc.net 전형적인 DFS 문제 import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static int[][] arr; public static boolean[][] visited; public static int[] dy = {-1,1,0,0,-1,1,-1,1}; public static int[] dx = {0,0,-1,1,-1..
https://www.acmicpc.net/problem/11725 11725번: 트리의 부모 찾기 루트 없는 트리가 주어진다. 이때, 트리의 루트를 1이라고 정했을 때, 각 노드의 부모를 구하는 프로그램을 작성하시오. www.acmicpc.net import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static ArrayList list[]; public static int[] parent; public static boolean[] visited; public static void main(String[] args) thro..
https://www.acmicpc.net/problem/1713 1713번: 후보 추천하기 첫째 줄에는 사진틀의 개수 N이 주어진다. (1 ≤ N ≤ 20) 둘째 줄에는 전체 학생의 총 추천 횟수가 주어지고, 셋째 줄에는 추천받은 학생을 나타내는 번호가 빈 칸을 사이에 두고 추천받은 순서대 www.acmicpc.net import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static HashMap keyMap; public static void main(String[] args) throws IOException { Buffe..
https://school.programmers.co.kr/learn/courses/30/lessons/92334 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.*; class Solution { public int[] solution(String[] id_list, String[] report, int k) { //유저가 신고한 ID를 가져올 수 있는 자료구조 사용하기 HashMap total = new HashMap(); HashMap reportCount = new HashMap(); int[] mail = new in..