본문 바로가기

728x90
반응형

스터디

(24)
[쿠버네티스] 쿠버네티스 기초 쿠버네티스란 https://kubernetes.io/ko/docs/concepts/overview/what-is-kubernetes/ 쿠버네티스란 무엇인가? 쿠버네티스는 컨테이너화된 워크로드와 서비스를 관리하기 위한 이식할 수 있고, 확장 가능한 오픈소스 플랫폼으로, 선언적 구성과 자동화를 모두 지원한다. 쿠버네티스는 크고 빠르게 성장하 kubernetes.io Open source container orchestration tool 쿠버네티스, 컨테이너, 도커 용어정리 컨테이너란, 우리가 구동하려는 애플리케이션을 실행할 수 있는 환경까지 감싸서, 어디서든 쉽게 실행할 수 있도록 해 주는 기술. PC에 프로그램을 설치할 때 특정 경로에 맞춰 설치를 해야 하거나, 내 컴퓨터에 필요한 옵션을 일일히 맞춰주느..
[medium] 916. Word Subsets 문제 https://leetcode.com/problems/word-subsets/ Word Subsets - 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 풀이방법 words1의 단어들 중 words2의 모든 단어를 subset으로 가질 수 있는 단어들을 찾는 문제이다. 시간 절약을 위해 words2에 대한 전처리가 매우 중요했다. words2의 단어들 중에 중복되는게 있을 수 있으므로 set으로 변환했다가 다시 list로 변환함으로써 중복을 제거한다. wor..
[medium] 240. Search a 2D Matrix II 문제 https://leetcode.com/problems/search-a-2d-matrix-ii/ Search a 2D Matrix II - 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 풀이방법 문제 보자마자 DFS로 중복방문 하지 않도록 하면서 풀면 되겠다는 생각이 들었다 1. [0,0] 위치부터 DFS 탐색을 시작한다 2. 탐색은 아래 과정을 반복한다 - 방문했던 곳이면 패스하고, 방문하지 않았던 곳이면 visited 를 True로 바꾸고 해당지점의 숫자..
[hard] 629. K Inverse Pairs Array 문제 https://leetcode.com/problems/k-inverse-pairs-array/ K Inverse Pairs Array - 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 풀이방법 숫자제한을 보니 제일 먼저 떠오르는 브루트포스로 풀면 시간초과가 날 수 밖에 없는 문제라서 DP로 접근해야겠다고 생각했다 그런데 DP 규칙을 어떻게 만들어야하는지... 역시 hard... 그래서 https://leetcode.com/problems/k-inverse-..
[medium] 576. Out of Boundary Paths 문제 https://leetcode.com/problems/out-of-boundary-paths/ Out of Boundary Paths - 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 풀이방법 중복방문 허용하면서 maxMove 이내로 움직여서 공을 칸 밖으로 내보낼 수 있는 경우의 수를 구하는 문제이다 처음에는 DFS로 접근하면 될 줄 알았는데 중복방문이 되다보니 시간초과가 났다 값을 저장하면서 처리해야 시간초과가 해결될 것 같은데 구현하는 과정에서 헷갈려..
[medium] 695. Max Area of Island 문제 https://leetcode.com/problems/max-area-of-island/ 풀이방법 자주 보이는 BFS 문제 유형이다. grid 전체를 탐색하는데 이미 방문한 곳은 체크하면서 중복 탐색하지 않도록 해야한다. (grid 값이 0인 부분은 탐색할 필요없다) 그리고 탐색하는 과정에서 1이 이어져있는 부분의 넓이를 계산하며 최대 넓이를 저장해두었다가, 전체 탐색이 끝나면 최대 넓이를 리턴한다. 그래서 시간복잡도는 O(M*N), 공간복잡도도 O(M*N) 코드 class Solution: def maxAreaOfIsland(self, grid: List[List[int]]) -> int: M = len(grid) N = len(grid[0]) visit = [[False]*N for i in r..
[medium] 1696. Jump Game VI 문제 https://leetcode.com/problems/jump-game-vi/ Jump Game VI - 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 풀이방법 보자마자 DP로 풀어야겠구나 싶었다 (계단 오르기 문제랑 비슷한 유형으로 보여서...) dp 배열을 -inf 로 초기화하고 각 index에 도달했을 때 최대 score를 dp 배열에 저장해가면서 풀면 된다 dp[n-1] = max(dp[n-1-1], dp[n-1-2], ..., dp[n-1-k]) ..
[medium] 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cut 문제 https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/description/ 풀이방법 가장 큰 사각형을 만드려면 가로와 세로가 각각 최대이면 된다. 가로가 최대인 것을 찾으려면 0, horizontalCuts, h 사이의 간격들 중에 가장 긴 부분을 길이를 찾아서 저장한다. 그런데 이 때 example2 처럼 horizontalCuts 혹은 verticalCuts 가 정렬되어있지 않을 수 있으므로, 먼저 정렬해주고 최대길이를 찾아야 한다. 비슷하게 세로가 최대인 것을 찾으려면 0, verticalCuts, w 사이의 간격들 중에 가장 긴 부분을 길이를 찾아서 저장한다. 그 다음이 ..

728x90
반응형