일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- dfs
- 개발자 취업
- 구현
- 코딩테스트준비
- 항해99
- 딥러닝
- 해시
- 코딩테스트 준비
- BFS
- 99항해
- softeer
- 개발자취업
- 스택
- BOJ
- Python
- 활성화 함수
- til
- boj 2309
- 백준
- python 2309
- 프로그래머스
- 기능개발
- 혁펜하임
- leetcode
- 99클럽
- 백준 2309
- 큐
- 알고리즘
- easy 딥러닝
- 파이썬
- Today
- Total
목록코딩테스트 준비 (42)
동까의 코딩
https://leetcode.com/problems/subrectangle-queries/ class SubrectangleQueries: def __init__(self, rectangle: List[List[int]]): self.rectangle = rectangle def updateSubrectangle(self, row1: int, col1: int, row2: int, col2: int, newValue: int) -> None: for i in range(row1, row2 + 1) : for j in range(col1, col2 + 1) : self.rectangle[i][j] = new..
https://school.programmers.co.kr/learn/courses/30/lessons/49191 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr def solution(n, results): answer = 0 board = [[0] * n for _ in range(n)] for a,b in results: board[a - 1][b - 1] = 1 board[b - 1][a - 1] = -1 for k in range(n): for i in range(n): ..

https://school.programmers.co.kr/learn/courses/30/lessons/49189 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr 그래프를 이용한 탐색 문제입니다. 그래프를 선언해 주고 해당 노드를 방문할 때마다 거리를 늘려주는 방법을 사용하여 저장하고 max값을 뽑아내줍니다. from collections import dequedef solution(n, edge): answer = 0 edge = sorted(edge) distance = [0] * (n + 1) queue = deque() ..
https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/submissions/1284760441/ leetcode 문제사이트에 있는 수열 문제입니다. class Solution(object): def findDays(self, weights, D, capacity): weight_sum = 0 days = 1 for w in weights: weight_sum += w if weight_sum > capacity: days += 1 weight_sum = w return days > D ..

https://school.programmers.co.kr/learn/courses/30/lessons/43238 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr 오늘의 문제는 이진탐색 문제입니다. 이진탐색에 대해서 알아보는 시간을 갖게 되었다.mid 값을 정해주고 left, right의 범위를 계속해서 좁혀주는 방법이다. def solution(n, times): answer = 0 left, right = 1, max(times) * n while left = n: break if p..
https://leetcode.com/problems/count-square-submatrices-with-all-ones/submissions/1282783267/ class Solution(object): def countSquares(self, matrix): if len(matrix) == 0 or len(matrix[0]) == 0: return 0 rows, cols = len(matrix), len(matrix[0]) dp = [[0 for _ in range(cols)] for _ in range(rows)] ans = 0 for i in range(rows): ..
leetcode 문제를 풀어 보았습니다. https://leetcode.com/problems/partition-array-for-maximum-sum/description/ class Solution: def maxSumAfterPartitioning(self, arr: List[int], k: int) -> int: n = len(arr) dp = [0] * (n + 1) for i in range(1, n + 1): max_val = float('-inf') for j in range(1, min(i, k) + 1): max_val = max(max_val, arr[i - j]) ..
https://leetcode.com/problems/count-sorted-vowel-strings/submissions/1280576421/ class Solution: f = {} def countVowelStrings(self, n): return self.nHr(5, n) def nHr(self, n, r): return self.fact(n+r-1) // self.fact(n-1) // self.fact(r) def fact(self, n): if n