프로그래머스

[코딩테스트] 프로그래머스 평균 일일 대여 요금 구하기 MySQL
https://school.programmers.co.kr/learn/courses/30/lessons/151136 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr SELECT ROUND(AVG(DAILY_FEE)) AS AVERAGE_FEE FROM CAR_RENTAL_COMPANY_CAR WHERE CAR_TYPE = 'SUV' WHERE문에서 CAR_TYPE = 'SUV'로 하여 자동차의 종류 중 SUV차량만 추출하였습니다. 그리고 SELECT 문에서 AVG() 함수를 사용하여 평균을 구하고, ROUND()를 함수를 적용하여 소수점 첫 번째 자리에서 ..

[코딩테스트] 프로그래머스 프린터 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/42587 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr from collections import deque def solution(priorities, location): temp = [(p, i) for i, p in enumerate(priorities)] temp = my_sort(temp) for i in range(len(temp)): if location == temp[i][1]: return i+1 def my_sort(temp): q ..

[코딩테스트] 프로그래머스 괄호 회전하기 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/76502 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr from collections import deque def solution(s): result = 0 s = deque(s) for i in range(len(s)): if check(s): result +=1 f = s.popleft() s.append(f) return result def check(s): stack = [] dic = {"}" : "{", "]" : "[", ")" : "(..

[코딩테스트] 프로그래머스 테이블 해시 함수 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/147354 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr from functools import reduce def solution(data, col, row_begin, row_end): s = sorted(data, key = lambda x : (x[col-1], -x[0])) numbers = [] result = 0 for i in range(row_begin, row_end+1): number = sum([n % i for n in s[i-..

[코딩테스트] 프로그래머스 개인정보 수집 유효기간 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/150370 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr from datetime import datetime def solution(today, terms, privacies): today_year = int(today.split('.')[0]) today_month = int(today.split('.')[1]) today_day = int(today.split('.')[2]) #terms 딕셔너리로 변경 term = {} result = [] f..

[코딩테스트] 프로그래머스 [1차] 뉴스 클러스터링 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/17677 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr from collections import Counter def solution(str1, str2): str1 = [str1[i:i+2].upper() for i in range(len(str1)-1) if str1[i:i+2].isalpha()] str2 = [str2[i:i+2].upper() for i in range(len(str2)-1) if str2[i:i+2].isalpha()] i..