Egg Dropping Problem

Today we will be talking about a very famous interview problem which is as follows: Given a certain amount of floors of a building (say k number of floors) and also given certain amount of eggs (say n number of eggs) … What is the least amount of egg drops Read more…

Maximum value

Question: Given a list of non-negative integers representing the value of each cell, determine the maximum amount of value you can get keeping in mind that you can’t use adjacent cells together. Now in this question, at first you might think of a greedy solution to take the largest element Read more…

Edit Distance

Question: Find the minimum number of operations required to convert a string X of length n to another string Y of length m. Operations allowed: Insertion Deletion Substitution We can solve this question by solving it’s sub-problem i.e., find the minimum number of operations required to convert a string X[0,…,i] Read more…

Longest Common subsequence

Question: Given two sequences, find the length of longest subsequence present in both. A subsequence is a sequence of characters of a string generated after deleting some or all characters from that string without changing the order of remaining string characters For example: If we have two string “abcde” and Read more…

0-1 Knapsack Dynamic Programming

Question: Given weights and profits of n items, put these items in a knapsack of capacity W to get the maximum total profit. 0-1 property:  You can either pick the item or not. Also you have only one copy of each item. Let’s solve this question first using brute force Read more…

$${}$$