본문 바로가기

Solving Algorithm Problem/LeetCode12

[LeetCode] 152. Maximum Product Subarray - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/maximum-product-subarray/ Maximum Product Subarray - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 정수 배열 nums가 주어질 때, 가장 큰 곱 값을 갖는 연속적인 하위 배열을 return 하는 문제이다. 이때, 하위 배열의 요소들은 연속되어야 한다. 예를 들어 num = [1,2,3.. 2022. 5. 13.
[LeetCode] 53. Maximum Subarray - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/maximum-subarray/ Maximum Subarray - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 정수 배열 nums가 주어지면, 가장 큰 합을 갖는 연속적인 하위 배열(최소한 하나의 숫자를 포함)을 찾아 return 하는 문제이다. 하위 배열은 배열의 연속적인 부분이다. Example 1) Input: nums.. 2022. 5. 13.
[LeetCode] 91. Decode Ways - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/decode-ways/ Decode Ways - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 숫자만 포함된 문자열 s가 주어지면 이를 디코딩하는 방법의 수를 return 하는 문제이다. A~Z까지의 문자들은 아래와 같이 숫자로 인코딩할 수 있다. 'A' -> '1' 'B' -> '2' ... 'Z' -> '26' 인코딩된 메.. 2022. 5. 13.
[LeetCode] 322. Coin Change - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/coin-change/ Coin Change - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 각각 다른 금액의 동전이 담긴 정수 배열 coins와 총 금액을 나타내는 정수 amount가 주어질 때, 해당 금액을 구성하는 데 필요한 동전의 최소 개수를 return 하는 문제이다. 각 종류의 동전은 무한히 있다고 가정한다(같은 .. 2022. 5. 13.
[LeetCode] 64. Minimum Path Sum - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/minimum-path-sum/ Minimum Path Sum - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 음수가 아닌 숫자들로 채워진 m x n 크기의 2차원 배열 grid가 주어질 때, 왼쪽 위에서 오른쪽 아래로 이어지는 경로 중 합이 최소가 되는 경로의 합을 찾아 return 하는 문제이다. 경로를 탐색할 때는 아래.. 2022. 5. 13.
[LeetCode] 746. Min Cost Climbing Stairs - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/min-cost-climbing-stairs/ Min Cost Climbing Stairs - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 계단을 밟는 비용이 담긴 정수 배열 cost가 주어질 때, 계단 꼭대기에 도달하기 위한 최소 비용을 return 하는 문제이다. 이때, 비용을 지불하면 계단을 1칸 또는 2칸을 오를 수 .. 2022. 5. 13.
[LeetCode] 70. Climbing Stairs - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/climbing-stairs/ Climbing Stairs - 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 유형 : 동적 계획법(Dynamic Programming) 문제 설명 한번에 계단을 1칸 혹은 2칸을 오룰 수 있을 때, 정수 n이 주어지면 n번째 계단에 오를 수 있는 방법의 개수를 return 하는 문제이다. Example 1) Input: n = 2 Output: 2 Example .. 2022. 5. 13.
[LeetCode] 39. Combination Sum - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/combination-sum/ Combination Sum - 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 유형 : 백트래킹(BackTracking) 문제 설명 중복되지 않는 정수들이 담긴 배열 candidates와 정수 target이 주어질 때, candidates에서 선택한 숫자들의 합이 target이 되는 조합을 찾아 모두 return 하는 문제이다. 이때, candidates의 숫자를 .. 2022. 5. 12.
[LeetCode] 77. Combinations - 파이썬(Python) 문제 링크 : https://leetcode.com/problems/combinations/ Combinations - 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 유형 : 백트래킹(BackTracking) 문제 설명 두 개의 정수 n, k가 주어질 때 1부터 n까지의 정수들에게 k개를 뽑아 만들 수 있는 모든 조합을 return 하는 문제이다. Example 1) Input: n = 4, k = 2 Output: [[2,4],[3,4],[2,3],[1,2],.. 2022. 5. 12.