PROGRAMMING/Algorithm

PROGRAMMING/Algorithm

[프로그래머스] 순위 검색 (python)

https://programmers.co.kr/learn/courses/30/lessons/72412 총 2**4 = 16개의 조건에 만족될 수 있다. 이 때, 만들어진 쿼리에 X 점수의 지원자가 한명 존재한다는 의미로 쿼리에 해당 지원자의 점수를 저장한다. 따라서 지원자는 총 16가지 key에 점수가 저장된다. (key 구성은 조건을 구별할 수 있도록 구성하면 된다.) -> ex. combination_dict["java backend junior pizza"] = [150] 그리고 쿼리가 들어오면, combination_dict에서 쿼리에 해당하는 조건을 찾아서 점수를 만족하면 count 해주면 된다. from collections import defaultdict def solution(info, ..

PROGRAMMING/Algorithm

[LeetCode] 38. Count and Say (python)

https://leetcode.com/problems/count-and-say/ Count and Say - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 📍 Problem count-and-say sequence는 재귀적으로 정의된 숫자 문자열로, - countAndSay(1) = '1' 로 시작해서, - countAndSay(n) 은 countAndSay(n-1) 를 읽은 문자열을 숫자로 표현한다. 예를 들어 Input n=2 인 경우, countAndSay..

KIM DEON
'PROGRAMMING/Algorithm' 카테고리의 글 목록 (2 Page)