[LeetCode] 322. Coin Change (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.You may assume that you have an infinite number of each kind of coin. 문제 예제Example ..
[LeetCode] 983. Minimum Cost For Tickets (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365.Train tickets are sold in three different ways:a 1-day pass is sold for costs[0] dollars,a 7-day pass is sold for costs[1] dollars, anda 30-day pass is sold for costs[2] dollars.The passes allow that man..
[LeetCode] 2466. Count Ways To Build Good Strings (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명Given the integers zero, one, low, and high, we can construct a string by starting with an empty string, and then at each step perform either of the following:Append the character '0' zero times.Append the character '1' one times.This can be performed any number of times.A good string is a string constructed by the above process having a length between low and high (inclusive).R..
[LeetCode] 3286. Find a Safe Walk Through a Grid (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명You are given an m x n binary matrix grid and an integer health. You start on the upper-left corner (0, 0) and would like to get to the lower-right corner (m - 1, n - 1). You can move up, down, left, or right from one cell to another adjacent cell as long as your health remains positive. Cells (i, j) with grid[i][j] = 1 are considered unsafe and reduce your health by 1. Return t..
[Kafka] Apache Kafka 개요
·
Data Engineering/Kafka
이번 글에서는 Apache Kafka에 대해 간단히 소개할 예정이다. 본 글의 목차는 다음과 같다.1. Kafka 등장 배경2. What is Kafka3. Kafka Architecture4. Pub/Sub 모델 1. Kafka 등장 배경 `Kafka`에 대해 알아보기 전, 어떻게 `Kafka`가 등장했는지 알아보자 초기 Linkedin 운영 시에는 단방향 통신을 통해 연동했으며, 아키텍처가 복잡하지 않아 운영에 어려움이 없었다. 하지만, 시간이 지날수록 source, target application의 개수가 많아져 아키텍처가 거대해짐에 따라 데이터를 전송하는 라인이 위 그림과 같이 많이 복잡해졌다. 또한, 한쪽에 장애가 생기면 다른 한 쪽에도 전달되는 문제가 발생해 유지 및 보수가 어려워지면서 관리..
[LeetCode] 1122. Relative Sort Array (Python)
·
알고리즘/LeetCode
난이도: Easy 문제 설명Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that the relative ordering of items in arr1 are the same as in arr2. Elements that do not appear in arr2 should be placed at the end of arr1 in ascending order. 문제 예제Example 1:Input: arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]Output..