목록전체 글 (287)
개발자는 기록이 답이다

https://school.programmers.co.kr/learn/courses/30/lessons/12909 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내가 푼 풀이 import java.util.*; class Solution { boolean solution(String s) { boolean answer = true; char[] charArray = s.toCharArray(); Stack stack = new Stack(); for (int i = 0; i < charArray.length; i++) { // 열린괄호 if (charAr..

https://school.programmers.co.kr/learn/courses/30/lessons/42578 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 테이블에 의상 종류별로 해싱하는거까지는 쉬웠는데, map : {eyewear=1, headgear=2} 이 상태에서 경우의 수를 구하는게 어려웠다. 2중 포문 하고 실패했는데, 검색해보니 훨씬 쉽게 푸는 방법이 있었다. import java.util.*; class Solution { public int solution(String[][] clothes) { int answer = 1; HashM..

https://school.programmers.co.kr/learn/courses/30/lessons/42577 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내가 푼 틀린 풀이 - 시간초과 채점 결과 정확성: 83.3 효율성: 8.3 합계: 91.7 / 100.0 HashMap이랑 startWith()함수 같이 사용해서 풀고 싶었는데, 최악의 경우 100만 길이의 입력값이 들어와서 시간초과가 나온다. 해당 풀이는 모든 전화번호에 대한 접두사를 비교하기 위해 중첩된 반복문을 사용하고 있다. 외부 루프에서는 phone_book 배열을 순회하고 내부 루프에..

https://school.programmers.co.kr/learn/courses/30/lessons/42576 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내가 푼 풀이 - 해쉬맵 사용 import java.util.*; class Solution { public String solution(String[] participant, String[] completion) { String answer = ""; HashMap map = new HashMap(); for (String x : participant) { map.put(x, map.getOrD..