[LeetCode] 2257. Count Unguarded Cells in the Grid - Python
·
알고리즘/LeetCode
난이도: Medium 문제 설명You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards and walls where guards[i] = [rowi, coli] and walls[j] = [rowj, colj] represent the positions of the ith guard and jth wall respectively.A guard can see every cell in the four cardinal directions (north, east, south, or west) starting from their position unless ..
[Programmers] 프렌즈4블록 - Python
·
알고리즘/프로그래머스
난이도: Lv. 2 📜 문제 설명블라인드 공채를 통과한 신입 사원 라이언은 신규 게임 개발 업무를 맡게 되었다. 이번에 출시할 게임 제목은 "프렌즈4블록".같은 모양의 카카오프렌즈 블록이 2×2 형태로 4개가 붙어있을 경우 사라지면서 점수를 얻는 게임이다.만약 판이 위와 같이 주어질 경우, 라이언이 2×2로 배치된 7개 블록과 콘이 2×2로 배치된 4개 블록이 지워진다. 같은 블록은 여러 2×2에 포함될 수 있으며, 지워지는 조건에 만족하는 2×2 모양이 여러 개 있다면 한꺼번에 지워진다. 블록이 지워진 후에 위에 있는 블록이 아래로 떨어져 빈 공간을 채우게 된다. 만약 빈 공간을 채운 후에 다시 2×2 형태로 같은 모양의 블록이 모이면 다시 지워지고 떨어지고를 반복하게 된다. 위 초기 배치를 문자로..
[Docker] 4. 간단한 Docker 실습
·
Docker 및 Kubernetes/Docker
이번 글에서는 Docker를 이용해 2가지의 간단한 실습에 대해 진행한 것을 포스팅할 예정이다. 이전글과 이어지니 안보신 분들을 읽고 오시는 것을 추천한다.Docker 이해하기 - 3.Docker 설치 및 명령어 Docker 이해하기 - 3. Docker 설치 및 명령어이번 글에서는 Docker 설치 방법과 간단한 Docker 명령어들에 대한 내용을 정리하려고 한다. 환경으로는 Ubuntu를 사용했다. 🐋 Docker 설치처음으로 Docker Engine을 설치하기 전에 Docker apt 저장소를 설laewonjeong.tistory.com  1. 간단한 Node.js 서버를 Docker로 실행해보기이 실습을 통해, Node.js 서버를 Docker 컨테이너 안에서 실행해보고 Docker의 기본적인 ..
[Docker] 3. Docker 설치 및 명령어
·
Docker 및 Kubernetes/Docker
이번 글에서는 Docker 설치 방법과 간단한 Docker 명령어들에 대한 내용을 정리하려고 한다. 환경으로는 Ubuntu를 사용했다. 🐋 Docker 설치처음으로 Docker Engine을 설치하기 전에 Docker apt 저장소를 설정해야한다. 그런 다음 저장소에서 Docker를 설치하고 업데이트 할 수 있다. Docker apt 저장소를 설정# Add Docker's official GPG key:sudo apt-get updatesudo apt-get install ca-certificates curlsudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/..
[LeetCode] 2461. Maximum Sum of Distinct Subarrays With Length K - Python
·
알고리즘/LeetCode
난이도: Medium문제 설명You are given an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that meet the following conditions:The length of the subarray is k, andAll the elements of the subarray are distinct.Return the maximum subarray sum of all the subarrays that meet the conditions. If no subarray meets the conditions, return 0.A subarray is a contiguous ..
[LeetCode] 1652. Defuse the Bomb - Python
·
알고리즘/LeetCode
문제 설명You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and a key k.To decrypt the code, you must replace every number. All the numbers are replaced simultaneously.If k > 0, replace the ith number with the sum of the next k numbers.If k previous k numbers.If k == 0, replace the ith number with 0.As code is circular, t..