Skip to main content

10 docs tagged with "Hard"

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.

Candy

There are N children standing in a line. Each child is assigned a rating value.

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.

Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).