[StrataScractch] Number Of Units Per Nationality [MySQL] https://platform.stratascratch.com/coding/10156-number-of-units-per-nationality?code_type=3 StrataScratch platform.stratascratch.com WITH UNDER_30 AS ( SELECT DISTINCT(host_id), nationality FROM airbnb_hosts WHERE age 프로그래머스 2022.06.25
[프로그래머스] 124 나라의 숫자 [C/C++] https://programmers.co.kr/learn/courses/30/lessons/12899 코딩테스트 연습 - 124 나라의 숫자 programmers.co.kr 코드 #include #include #include #include using namespace std; string solution(int n) { string answer = ""; for (int i = 0; pow(3, i) 프로그래머스 2022.06.23
프로그래머스 - 이중우선순위큐 [C/C++] https://programmers.co.kr/learn/courses/30/lessons/42628 코딩테스트 연습 - 이중우선순위큐 programmers.co.kr 코드 #include #include #include using namespace std; priority_queue maxHeap, minDeleteHeap; priority_queue minHeap, maxDeleteHeap; vector solution(vector operations) { for (auto& iter: operations) { if (iter[0] == 'I') { string s(iter.begin() + 2, iter.end()); maxHeap.push(stoi(s)); minHeap.push(stoi(s));.. 프로그래머스 2022.06.20
프로그래머스 - 등굣길 [C/C++] https://programmers.co.kr/learn/courses/30/lessons/42898 코딩테스트 연습 - 등굣길 계속되는 폭우로 일부 지역이 물에 잠겼습니다. 물에 잠기지 않은 지역을 통해 학교를 가려고 합니다. 집에서 학교까지 가는 길은 m x n 크기의 격자모양으로 나타낼 수 있습니다. 아래 그림은 m = programmers.co.kr 코드 #include #include using namespace std; int M, N; long long dp[101][101]; int map[101][101]; int dy[2] = {0, 1}; int dx[2] = {1, 0}; long long dfs (int y, int x) { if (y == M and x == N) return 1.. 프로그래머스 2022.06.20
프로그래머스 - 정수 삼각형 [C/C++] https://programmers.co.kr/learn/courses/30/lessons/43105 코딩테스트 연습 - 정수 삼각형 [[7], [3, 8], [8, 1, 0], [2, 7, 4, 4], [4, 5, 2, 6, 5]] 30 programmers.co.kr 코드 #include #include using namespace std; int dp[501][501]; int solution(vector triangle) { int n = triangle.size(); dp[0][0] = triangle[0][0]; for (int i = 1; i 프로그래머스 2022.06.20
프로그래머스 - 완주하지 못한 선수 [C/C++] https://programmers.co.kr/learn/courses/30/lessons/42576 코딩테스트 연습 - 완주하지 못한 선수 수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수 programmers.co.kr 코드 #include #include #include using namespace std; string solution(vector participant, vector completion) { string answer = ""; map m; for (auto& iter: participant) if (m.find(iter) != m.end().. 프로그래머스 2022.06.18