All Posts

Leetcode 518: Coin Change II

Given a set of coins of different denominations, determine how many distinct combinations of these coins sum up to the target amount.

Leetcode 542: 01 Matrix

Given an m x n binary matrix, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1.

Leetcode 553: Optimal Division

Given an array of integers, you need to add parentheses in such a way that the division expression evaluates to the maximum possible value. The division must respect the adjacency of integers in the array.

Leetcode 576: Out of Boundary Paths

You are given an m x n grid and a ball placed at position [startRow, startColumn]. The ball can move to one of four adjacent cells or out of the grid boundary. You are allowed at most maxMove moves. Return the number of ways the ball can move out of the grid boundary modulo 10^9 + 7.

Leetcode 583: Delete Operation for Two Strings

Given two strings word1 and word2, return the minimum number of steps required to make word1 and word2 the same. In one step, you can delete exactly one character in either string.

Leetcode 638: Shopping Offers

In a store, there are n items available for sale, each with a given price. You are also given a list of special offers where you can buy multiple items at a discounted price. Your task is to determine the minimum total price to purchase the required quantities of each item, while utilizing the special offers optimally. You can use any offer as many times as you like, but cannot buy more items than you need.