Leetcode 0221. Maximal Square

Posted on Wed 04 December 2024 in Leetcode • Tagged with dp-2d

Question Link : https://leetcode.com/problems/maximal-square/

Difficulty: Medium

Premium: False

Question

Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.   Example 1:

Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1 …


Continue reading

Leetcode 0322. Coin Change

Posted on Thu 05 September 2024 in Leetcode • Tagged with knapsack-unbounded, dp-2d

Question Link : https://leetcode.com/problems/coin-change/

Difficulty: Medium

Premium: False

Question

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 …


Continue reading

Leetcode 0064. Minimum Path Sum

Posted on Sun 26 March 2023 in Leetcode • Tagged with dp-2d, dp

Question Link : https://leetcode.com/problems/minimum-path-sum/

Difficulty: Medium

Premium: False

Question

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right …


Continue reading

Leetcode 1143. Longest Common Subsequence

Posted on Wed 14 December 2022 in Leetcode • Tagged with dp-2d

Question Link : https://leetcode.com/problems/longest-common-subsequence/

Difficulty: Medium

Premium: False

Question

Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence of a string is a new string generated from the original string with some …


Continue reading

Leetcode 0931. Minimum Falling Path Sum

Posted on Mon 12 December 2022 in Leetcode • Tagged with dp-2d

Question Link : https://leetcode.com/problems/minimum-falling-path-sum/

Difficulty: Medium

Premium: False

Question

Given an n x n array of integers matrix, return the minimum sum of any falling path through matrix. A falling path starts at any element in the first row and chooses the element in the next row …


Continue reading