Skip to main content

6 docs tagged with "Dynamic Programming"

View All Tags

Buy and Sell Stock 3

Say you have an array for which the ith element is the price of a given stock on day i.

Buy and Sell Stocks 1

Say you have an array for which the i-th element is the price of a given stock on day i.

Climbing Stairs

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

Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of S which equals T.

Dungeon Game

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially positioned in the top-left room and must fight his way through the dungeon to rescue the princess.

Edit Distance

Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.