All Posts

Leetcode 733: Flood Fill

You are given an m x n grid representing an image, where each element in the grid corresponds to a pixel value. Additionally, you’re provided with three integers: sr (starting row), sc (starting column), and color. Your task is to perform a flood fill operation on the image starting at the pixel located at (sr, sc).

Leetcode 735: Asteroid Collision

You are given an array of integers representing asteroids in a row. Each asteroid has a size and a direction, with positive integers representing asteroids moving right and negative integers representing asteroids moving left. You need to determine the state of the asteroids after all collisions.

Leetcode 739: Daily Temperatures

Given an array of integers temperatures representing the daily temperatures, return an array where each element is the number of days you need to wait after that day to get a warmer temperature. If there is no future day for which this is possible, keep the answer as 0.

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 744: Find Smallest Letter Greater Than Target

You are given a sorted array letters containing lowercase English letters and a character target. Return the smallest character in letters that is lexicographically greater than target. If no such character exists, return the first character in letters.

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.