Underscorify Substring
Underscorify Substring In this question, you are provided with two strings. The first one, called the main string is the longer string. The smaller string is also called the su…
Explore the latest articles and tutorials in Data Structures And Algorithms
Underscorify Substring In this question, you are provided with two strings. The first one, called the main string is the longer string. The smaller string is also called the su…
Text Justify Text Justification problem is known by various names. These include word wrap and typographical alignment. When using word processing tools like Microsoft …
String Distance This algorithm goes by many names. You could for example have heard of edit distance and Levenshtein distance which refers to the same algorithm. It expresse…
Count Derangements In combinatorics, a derangement of a set is a permutation of its elements in which none of the elements appear in their original position. In other words, a …
Aircraft Spacing This problem deals with airports and air traffic controllers. Specifically, we want to decide from a set of aircraft which ones to land and which ones to put o…
Recursion Recursion is a useful tool to solve certain types of problems. The use case here is to help us arrive at a dynamic programming solution. A recursive function is a …
Maximum Sum of a Contiguous Subarray Find the contiguous subarray within an array (containing at least one number) that has the largest sum. For example, given the array [-2…
Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction(i.e…
House Robber Problem You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed; the only constraint stopping you fro…
Understanding the Problem To solve the problem of climbing stairs, you can use a technique called dynamic programming. Dynamic programming is a method for solving problems by b…