This blog post covers a variation of the Next Greater Element II problem on Leetcode. It is one of the problems which requires very clever use of a simple data structure. …

This blog post covers the Shortest Path In A Grid With Obstacles Elimination problem on Leetcode.

This problem illustrates how a standard graph traversal algorithm can solve a tricky problem if we smartly encode multiple parameters into the graph state.

You are given an

`m x n`

grid, where each…

This blog post covers the Predict The Winner problem on Leetcode. It is a dynamic programming problem. The solution is not too hard once we know exactly what to compute.

T**his post digs deeper into the problem statement to break it down and see how it leads to a DP solution…**

This blog post covers the Bursting Balloons problem on Leetcode. It is a dynamic programming problem in which coming up with the sub-problem definition is hard.

Instead of directly explaining the solution, **this post goes through the thought process of formulating the DP solution in a step-by-step manner.**

You are…

Coordinate compression is a technique to map a large set of points to a smaller range by removing gaps and/or redundant information. By compressing the points to a smaller range, we can save considerable time and memory.

Most of you would have unknowingly applied 1D coordinate compression but it’s 2D…