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…

Kadane’s algorithm

Today we will be talking about largest sum subarray using O(1) extra space and with O(N) time complexity using Kadane’s algorithm which is based on dynamic programming. Question: Given an array of size n, find the largest continuous subarray (having at least one element) with the maximum sum. Now the Read more…

Insert math as
Additional settings
Formula color
Text color
Type math using LaTeX
Nothing to preview