그럴듯한 개발 블로그
프로그래머스 최댓값과 최솟값 c++

https://school.programmers.co.kr/learn/courses/30/lessons/12939 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 와재밌다~ #include #include using namespace std; string solution(string s) { string answer = ""; int min_n, max_n, first_flag = 1; for (int i = 0; i < s.size(); i++) { int cur = 0, minus = 1; if (s[i] == '-') // 부호 찾음 { minus =..

프로그래머스 jadencase 문자열 만들기 c++

https://school.programmers.co.kr/learn/courses/30/lessons/12951 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 이게 왜 2단계인가 싶다 1단계 문제들 중에 어려운 문제 훨씬 많았는디... #include #include #include using namespace std; string solution(string s) { int first_flag = 1; for (int i = 0; i = 'A' && s[i] = 'a' && s..

프로그래머스 신규 아이디 추천 c++

https://school.programmers.co.kr/learn/courses/30/lessons/72410 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 처음 풀어 보는 문자열 파싱 문제다. minishell 파싱 순한 맛이다. 눈만 크게 뜨고 있으면 쉬운 문제였다. #include #include #include using namespace std; string get_delete_x_string(string original) { string res = ""; for (int i = 0; i < original.size(); i++) if (or..

프로그래머스 성격 유형 검사하기 c++

https://school.programmers.co.kr/learn/courses/30/lessons/118666 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 카카오 문제들은 헷갈리는 부분들이 좀 많은 것 같다. 풀다 보니 상당히 드럽게 됐는데, 그래도 빠른 게 낫겠지...? #include #include #include #include using namespace std; string solution(vector survey, vector choices) { string answer = ""; unordered_map map; map['R'] = ..

프로그래머스 신고 결과 받기 c++

https://school.programmers.co.kr/learn/courses/30/lessons/92334 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 처음 풀이 이름 = 횟수로 map에 담아서 확인해 준다. 근데 c++엔 split이 없는데 매번 구현해서 풀어야 하는 건지.. #include #include #include #include using namespace std; vector split(string s, char sep) { vector result; for (int i = 0; i < s.size(); i++) { if (s[i]..

프로그래머스 대충 만든 자판 c++

https://school.programmers.co.kr/learn/courses/30/lessons/160586 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문자 별로 cnt 값을 map에 저장해 두고 target을 순회하면서 더해준다. #include #include #include #include using namespace std; vector solution(vector keymap, vector targets) { vector answer; unordered_map map; for (int i = 0; i < keymap.size(); i+..