These rules are adopted from the AngularJS commit conventions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
from collections import defaultdict | |
def solution(orders, course): | |
answer = [] | |
max_set = defaultdict(int) # {len: cnt} | |
course_dict = defaultdict(int) | |
for order in orders: | |
order = ''.join(sorted(order)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://programmers.co.kr/learn/courses/30/lessons/81302 | |
from collections import defaultdict, deque | |
def solution(places): | |
SIZE = 5 | |
answer = [] | |
for place in places: | |
graph = place |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://programmers.co.kr/learn/courses/30/lessons/77486 | |
def solution(enroll, referral, seller, amount): | |
PRICE_OF_TOOTHBRUSH = 100 | |
ANCESTOR_PROFIT_RATIO = 0.1 | |
answer = [] | |
parent_dict = dict(zip(enroll, referral)) | |
profit_dict = {key: 0 for key in enroll} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://programmers.co.kr/learn/courses/30/lessons/85002 | |
def solution(weights, head2head): | |
answer = [] | |
record_list = get_record_list(weights, head2head) | |
record_list.sort(key = lambda x: (-x[0], -x[1], -x[2], x[3])) | |
answer = [record[3]+1 for record in record_list] | |
return answer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://programmers.co.kr/learn/courses/30/lessons/84512 | |
import sys | |
sys.setrecursionlimit(10**6) | |
def solution(word): | |
global cnt | |
global answer | |
answer = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
def parse_to_sec(line): | |
T = 60 | |
splitted_line = line.split(' ') | |
required_time = float(splitted_line[2][:-1]) | |
h, m, s = splitted_line[1].split(':') | |
end = int(h) * T ** 2 + int(m) * T + float(s) | |
start = round(end - required_time + 0.001, 3) |