bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Easy1-D Dynamic ProgrammingLC 746

Min Cost Climbing Stairs

You are given an integer array cost where cost[i] is the cost of ith 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. Return the minimum cost to reach the top of the floor.

Asked at 4 companies
AdobeAmazonBloomberg
Hints
  • 1.Think about what data structure fits Min Cost Climbing Stairs
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode