All Posts

Leetcode 712: Minimum ASCII Delete Sum for Two Strings

Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make the two strings equal.

Leetcode 714: Best Time to Buy and Sell Stock with Transaction Fee

You are given an array prices where prices[i] represents the price of a stock on the i-th day, and an integer fee that represents a transaction fee for each transaction. The task is to calculate the maximum profit you can achieve. You may complete as many transactions as you like, but you need to pay the transaction fee for each transaction.

Leetcode 718: Maximum Length of Repeated Subarray

Given two integer arrays nums1 and nums2, your task is to find the maximum length of a contiguous subarray that appears in both arrays.

Leetcode 740: Delete and Earn

You are given an integer array nums. You want to maximize the number of points you can earn by performing the following operation any number of times: Pick any nums[i] and delete it to earn nums[i] points. Afterwards, you must delete every element equal to nums[i] - 1 and every element equal to nums[i] + 1.

Leetcode 746: Min Cost Climbing Stairs

You are climbing a staircase with a cost associated with each step. You can either start at the first or second step. At each step, you can either move one step or skip one step. Find the minimum cost to reach the top of the staircase.

Leetcode 764: Largest Plus Sign

You are given an integer n, which represents the size of an n x n binary grid. Initially, all the values in the grid are set to 1, except for some indices that are specified in the array mines. Your task is to find the order of the largest axis-aligned plus sign of 1’s in the grid. A plus sign of order k has a center grid[r][c] == 1 with arms extending in all four directions (up, down, left, right) of length k - 1.