Text Justify
Text Justify Text Justification problem is known by various names. These include word wrap and typographical alignment. When using word processing tools like Microsoft word, they all have …
Continue ReadingExplore the latest articles and tutorials in
Text Justify Text Justification problem is known by various names. These include word wrap and typographical alignment. When using word processing tools like Microsoft word, they all have …
Continue ReadingString 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 expresses the way we define …
Continue ReadingCount 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 derangement is a per…
Continue ReadingAircraft 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 on hold. The air t…
Continue ReadingRecursion 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 function that calls …
Continue ReadingMaximum 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, 1, -3, 4, -1, 2, 1…
Continue ReadingBuy 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., buy one and sell …
Continue ReadingHouse 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 from robbing each of th…
Continue ReadingUnderstanding 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 breaking them down in…
Continue ReadingDynamic Programming Dynamic Programming is an algorithmic method for solving optimization problems by breaking them(a problem or problems) into smaller subproblems. It is an algorithm…
Continue ReadingText Justify Text Justification problem is known by various names. These include word wrap and typographical alignment. When using word pr…
Read MoreString Distance This algorithm goes by many names. You could for example have heard of edit distance and Levenshtein distance which refers to the …
Read MoreCount Derangements In combinatorics, a derangement of a set is a permutation of its elements in which none of the elements appear in their origina…
Read MoreAircraft Spacing This problem deals with airports and air traffic controllers. Specifically, we want to decide from a set of aircraft which ones t…
Read MoreMaximum Sum of a Contiguous Subarray Find the contiguous subarray within an array (containing at least one number) that has the largest sum. Fo…
Read MoreBuy 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 comple…
Read MoreHouse Robber Problem You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed; the on…
Read MoreUnderstanding the Problem To solve the problem of climbing stairs, you can use a technique called dynamic programming. Dynamic programming is a me…
Read MoreDynamic Programming Dynamic Programming is an algorithmic method for solving optimization problems by breaking them(a problem or problem…
Read More