Latest Articles

Quickselect Algorithm Data Structures and Algorithms

Quickselect Algorithm

Quickselect Algorithm The quickselect algorithm seeks to find the kth smallest value or the kth largest value in an input array in linear time on …

Longest Substring Without Duplicates Data Structures and Algorithms

Longest Substring Without Duplicates

Longest Substring Without Duplicates In this question, I hope to help you find the longest substring without duplicates by first getting the conce…

Underscorify Substring Data Structures and Algorithms

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 smalle…

Text Justify Data Structures and Algorithms

Text Justify

Text Justify Text Justification problem is known by various names. These include word wrap and typographical alignment. When using word pr…

String Distance Data Structures and Algorithms

String Distance

String Distance This algorithm goes by many names. You could for example have heard of edit distance and Levenshtein distance which refers to the …

Count Derangements Data Structures and Algorithms

Count Derangements

Count Derangements In combinatorics, a derangement of a set is a permutation of its elements in which none of the elements appear in their origina…

Aircraft Spacing Data Structures and Algorithms

Aircraft Spacing

Aircraft Spacing This problem deals with airports and air traffic controllers. Specifically, we want to decide from a set of aircraft which ones t…

Recursion Data Structures and Algorithms

Recursion

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.…

Maximum Sum of a Contiguous Sub array Data Structures and Algorithms

Maximum Sum of a Contiguous Sub array

Maximum Sum of a Contiguous Subarray Find the contiguous subarray within an array (containing at least one number) that has the largest sum. Fo…

Buy and Sell Stock Data Structures and Algorithms

Buy and Sell Stock

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 comple…