일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- utils
- Python
- SQL
- greedy
- 백준
- stateful
- Unit Testing
- Query
- codecov
- AWS
- algorithm
- combinations
- ws
- Q objects
- Bruteforce
- pytest
- was
- postreSQL
- stateless
- Stack
- permutations
- dictionary
- Git
- HTTP 완벽 가이드
- Django
- stack&que
- TDD
- ORM
- Gunicorn
- Programmers
- Today
- Total
목록Programmers (16)
해피 코딩!
link def solution(participant, completion): from collections import defaultdict dic = defaultdict(int) for part in participant: dic[part] += 1 for comp in completion: dic[comp] -= 1 return max(dic, key=dic.get)
link def solution(answers): answer = [] soopo_1 = [1, 2, 3, 4, 5,] soopo_2 = [2, 1, 2, 3, 2, 4, 2, 5] soopo_3 = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] soopo1 = 0 soopo2 = 0 soopo3 = 0 for index in range(len(answers)): if soopo_1[index % len(soopo_1)] == answers[index]: soopo1 += 1 if soopo_2[index % len(soopo_2)] == answers[index]: soopo2 += 1 if soopo_3[index % len(soopo_3)] == answers[index]: soopo3 +..
link def solution(numbers): answer = [] for val in range(len(numbers)): for val_2 in range(len(numbers)): if val == val_2: pass else: value = numbers[val] + numbers[val_2] answer.append(value) answer = set(answer) # print(list(answer)) return sorted(answer)
문제 링크 def solution(bridge_length, weight, truck_weights): answer = 0 bridge = bridge_length * [0] while bridge: bridge.pop(0) answer += 1 if truck_weights: head = truck_weights[0] if sum(bridge) + head
문제 링크 def solution(a, b): answer = 0 for a_var, b_var in zip(a, b): result = a_var * b_var answer += result return answer
해당 문제 링크 def solution(progresses, speeds): answer = [] while progresses: for index, value in enumerate(progresses): progresses[index] += speeds[index] cnt = 0 while progresses and progresses[0] >= 100: progresses.pop(0) speeds.pop(0) cnt += 1 if cnt: answer.append(cnt) return answer 정말 매번 고민하지만 너무 어렵게 생각하는 것 같다.. 결국 인터넷을 참고하여 문제를 풀게 되었으며 답을 보게 되면 왜 이렇게 생각을 못하였는지 항상 아쉬움이 남는다.
문제 링크 def solution(arr): answer = [arr[0]] for index in arr[1:]: if index == answer[-1]: pass elif index != answer[-1]: answer.append(index) return answer
해당 문제 링크 ```python def solution(n): answer = 0 n_number = '' # 진법을 계산하는 알고리즘을 인터넷을 통해 알게 되었다. while n >0: div = n // 3 mod = n % 3 n_number += str(mod) n = div value = 0 for index, i in enumerate(n_number[::-1]): if index == 0: answer += int(i) value = 3 else: answer += int(i) * value value *= 3 return answer ```