Write summaries of KMP Algorithm, Boyer-Moore string-search algorithm, Rabin-Karp Algorithm

Problem Statement

Given a search string N='ABCDEFGHIJKLMNOPQRSTUVWXYZ' and a pattern M='DEF' , we want to see if the pattern M can be found in the string N.

Naive Approach

The Naive implementation of the search algorithm will compare the pattern M against all possible…


The Largest Divisible Subset problem is a great problem which embodies many critical concepts to more advanced interviewing problems such as Dynamic Programming and Backtracking. The high-level reason why Dynamic Programming is useful in the solution is that we are asked to find the maximum of a given computation. Many…


The Knapsack problem, according to Wikipedia, is one of the most studied problems in combinatorial optimization.

The general description of the knapsack problem is the following:

  • Given a set of n items, where each item has an associated profit p_j and a corresponding weight w_j , perform a series of…


I have been intrigued by Leet Code style questions for a while. I have been very inspired by channels like Back to Back SWE, who goes beyond the code to develop a deep understanding of what is happening.

This is my attempt to give back.

Problem Statement

Two City Scheduling — Prompt

The Two City Scheduling problem…

Adam Garcia

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store