반응형 전체 글99 [프로그래머스/JAVA] 숫자 문자열과 영단어 👇 문제 URL 👇 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스 코드 String[] engNum = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; //i는 0~9 for(int i=0; i 2022. 7. 24. [프로그래머스/JAVA] 신규 아이디 추천 👇 문제 URL 👇 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public String solution(String new_id) { String answer = ""; //1단계 new_id = new_id.toLowerCase(); System.out.println("1단계 :"+new_id); //2단계 StringBuffer sb = new StringBuffer(); for(int i=0; i= 16){ new_id = new_id.substring(0, 15); new_id = new_id.replaceAll(.. 2022. 7. 24. [프로그래머스/JAVA] 로또의 최고 순위와 최저 순위 👇 문제 URL 👇 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr class Solution { public int[] solution(int[] lottos, int[] win_nums) { int[] answer = new int[2]; int cnt = 0; int zeroCnt = 0; for(int num : lottos){ if(num ==0){ zeroCnt ++; } for(int win_num : win_nums){ if(num == win_num){ cnt++; } } } int minCnt = cnt; int maxCnt = cnt+z.. 2022. 7. 24. [프로그래머스/JAVA] 신고 결과 받기 👇 문제 URL 👇 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr import java.util.HashMap; import java.util.HashSet; import java.util.Map; public static int[] solution(String[] id_list, String[] report, int k) { int[] answer = new int[id_list.length]; // HashMap : Key-value, hashSet: set 중 성능이 가장 좋음 // key : 신고된 ID, value : 신고한 ID set Map .. 2022. 7. 24. [Spring] 빈(bean)을 등록하는 방법 1. 컴포넌트 스캔과 자동 의존관계 설정 컴포넌트 스캔의 원리 @Component 어노테이션이 선언되어 있으면 스프링 빈으로 자동 등록 @Controller 컨트롤러가 스프링 빈으로 자동 등록된 이유도 컴포넌트 스캔 때문! (@Controller 어노테이션을 살펴보면 @Component가 선언된 것을 볼 수 있음) @Service, @Repository도 마찬가지로 @Component가 선언되어 있어 스프링 빈으로 자동 등록 된다. 예시 OrderController.java @Controller public class OrderController { private final OrderService orderService; @Autowired public OrderController(OrderServic.. 2022. 7. 1. [Intellij] 맥에서 svn 설정하기 - Subversion 윈도우만 쓰다가 맥 쓰려니까.. 쉽지 않다.. 1. Subversion 설치 Apache Subversion Binary Packages Apache Subversion Binary Packages The Apache Subversion project does not officially endorse or maintain any binary packages of the Subversion software. However, volunteers have created binary packages for different distributions and platforms, and as a con subversion.apache.org homebrew가 설치되어 있지 않으면 이 글 먼저 보고 와주세요:) [Ma.. 2022. 7. 1. 이전 1 2 3 4 5 ··· 17 다음 728x90 반응형