Skip to main content
198, House Robber

I Problem

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night.


MikeAbout 2 mindynamic programmingmediumarraydynamic programming
740, Delete and Earn

I Problem

You are given an integer array nums. You want to maximize the number of points you get 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.

MikeAbout 3 mindynamic programmingmediumarrayhash tabledynamic programming
746, Min Cost Climbing Stairs

I Problem

You are given an integer array cost where cost[i] is the cost of iᵗʰ step on a staircase. Once you pay the cost, you can either climb one or two steps.

You can either start from the step with index 0, or the step with index 1.


MikeAbout 2 mindynamic programmingeasyarraydynamic programming
134, Gas Station

I Problem

There are n gas stations along a circular route, where the amount of gas at the iᵗʰ station is gas[i].

You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the iᵗʰ station to its next (i + 1)ᵗʰ station. You begin the journey with an empty tank at one of the gas stations.


MikeAbout 3 mingreedymediumarraygreedy
53, Maximum Subarray

I Problem

Given an integer array nums, find the subarray with the largest sum, and return its sum.

Example 1
Input: nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
Output: 6
Explanation: The subarray [4, -1, 2, 1] has the largest sum 6.


MikeAbout 3 mingreedymediumarraydivide and conquerdynamic programming
56, Merge Intervals

I Problem

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.

Example 1
Input: intervals = [[1, 3], [2, 6], [8, 10], [15, 18]]
Output: [[1, 6], [8, 10], [15, 18]]
Explanation: Since intervals [1, 3] and [2, 6] overlap, merge them into [1, 6].


MikeAbout 2 mingreedymediumarraysorting
435, Non-overlapping Intervals

I Problem

Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.

Example 1
Input: intervals = [[1, 2], [2, 3], [3, 4], [1, 3]]
Output: 1
Explanation: [1, 3] can be removed and the rest of the intervals are non-overlapping.


MikeAbout 2 mingreedymediumarraygreedydynamic programming
452, Minimum Number of Arrows to Burst Balloons

I Problem

There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You do not know the exact y-coordinates of the balloons.


MikeAbout 2 mingreedymediumarraygreedysorting
45, Jump Game II

I Problem

You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].

Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you can jump to any nums[i + j] where:


MikeAbout 1 mingreedymediumarraygreedydynamic programming
55, Jump Game

I Problem

You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.

Return true if you can reach the last index, or false otherwise.


MikeAbout 1 mingreedymediumarraygreedydynamic programming
2
3
4
5
6