shreyansh

Dynamic Programming Problems

  1. Best Time to Buy and Sell Stock

    You are given an array prices where prices[i] is the price of a given stock on the ith day.

  2. Best Time to Buy and Sell Stock II

    You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

  3. Climbing Stairs

    You are climbing a staircase. It takes n steps to reach the top.

  4. Coin Change II

    You are given an integer array coins representing coins of different denominations and an integer amount representing a

  5. Distinct Subsequences

    Given two strings s and t, return the number of distinct subsequences of s which equals t.

  6. Edit Distance

    Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

  7. Friends Pairing Problem

    Given N friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only o

  8. Frog Jump Codestudio

    There is a frog 🐸 on the 1st step of an N stairs long staircase. The frog wants to reach the Nth stair. HEIGHT[i] is th

  9. House Robber

    You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, t

  10. House Robber II

    You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. A

  11. Longest Common Subsequence

    Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subseque

  12. Minimal Cost OR Frog with K distance

    There are n stones and an array of heights and Geek is standing at stone 1 and can jump to one of the following: Stone i

  13. Minimum Falling Path Sum

    Given an n x n array of integers matrix, return the minimum sum of any falling paththrough matrix.

  14. Minimum Path Sum

    Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum

  15. Ninja Training

    Ninja is planing this β€˜N’ days-long training schedule. Each day, he can perform any one of these three activities. (Runn

  16. Number of Dice Rolls With Target Sum

    You have n dice, and each dice has k faces numbered from 1 to k. Given three integers n, k, and target, return the numbe

  17. Partition equal Subset Sum

    Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elemen

  18. Rod Cutting

    Given a rod of length β€˜N’ units. The rod can be cut into different sizes and each size has a cost associated with it. De

  19. Shortest Common SuperSequence

    Given two strings str1 and str2, return the shortest string that has both str1and str2 as subsequences. If there are mul

  20. Subset Sum Equal To K

    You are given an array/list β€˜ARR’ of β€˜N’ positive integers and an integer β€˜K’. Your task is to check if there exists a s

  21. Unique Paths

    There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot t

  22. Unique Paths II

    Same question just with Obstacles in the grid.

  23. Wildcard Matching

    Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '' where: