Crack The Coding Interview (DSA Sheet)

===============================
Arrays Questions
===============================

Arrays: Given an array of integers in ascending order, return index of the two numbers such that they add up to a specific key provided. 

Arrays: Sort an array of 0s, 1s and 2s in C 

Arrays: Given an array, the difference between the elements is one, find if the “key” element is present or not. 

Arrays: Given an unsorted array, find the minimum difference between 2 elements. 

Arrays: Given an unsorted array, find the least difference between the element pairs. Display all the pairs present. 

Arrays: Given an unsorted array, and a key. Find 2 elements such that the difference between the elements is equal to the key. 

Arrays: Given an unsorted integer array, find the smallest missing positive integer. 

Arrays: Given an array, find all the repeated elements in C language.

Arrays: Given an integer value, convert it into roman number.

Arrays: Given a string, and number of rows, write the string in zigzag pattern. 

Arrays: Find the Container with Most Water explanation with diagram and solution 

Arrays: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.

Arrays: Given a collection of candidate numbers and a key, find all unique combinations in candidates where the candidate numbers sums to target.

Arrays: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

Arrays: Given a collection of numbers that might contain duplicates, return all possible unique permutations in C++

Arrays: Given an array of non-negative integers determine if you are able to reach the last index in C++

Arrays: Merge Intervals in C++

Arrays: Jump Game II in CPP

Arrays: Sort Colors In Place

Arrays: Given two integers n and k, return all possible combinations of k numbers out of 1 … n.

Arrays: Given a set of distinct integers, nums, return all possible subsets (the power set).

Arrays: Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.

Arrays: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.

Arrays: Insert Interval

Arrays: Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.

Arrays: Pascal’s triangle 2

Arrays: Given a triangle, find the minimum path sum from top to bottom.

Arrays: Best time to buy sell stock

Arrays: Given a non-empty array of integers, every element appears twice except for one. Find that single one.

Arrays: Given an integer array, find the maximum product made from continuous elements in that array. Solution in C++

Arrays: Find the minimum element from an array that is sorted and is rotated, solution in C++

Arrays: Given an array, find the majority element, solution in C++

Arrays: Given an array and a key element, find the number of continuous elements whose sum is greater than the key element.

Arrays: Given the heights of histogram using an array, you need to find the largest area rectangle in that histogram. Solution in C++

Arrays: You are given an unsorted array, and a key number, find the largest number of that key position.

Arrays: Given an array, that has zero. Move all the zero at the end, but maintain the relative order of other elements.

Arrays: Find the k’th smallest/largest element in an array

Arrays: Move all the negative number in beginning

Arrays: Find the union and intersection of two sorted arrays

Arrays: Given an array, rotate it one time

Arrays: Minimize the maximum difference between the heights

Arrays: Merge Two Sorted arrays without using extra space

Arrays: Inversion Count in an Array

Arrays: Find common element in 3 sorted arrays.

Arrays: Rearrange the array with one positive and one negative number.

Arrays: Find whether an array is subset of another array

Arrays: Find a triplet that sum to a given value

Arrays: Three way partitioning of an array around a given range

Arrays: Find the median of 2 sorted arrays of same size

Arrays: Merge sorted array inplace

Arrays: Find triplet with minimum sum

Arrays: Program to check if an Array is Palindrome or not

Arrays: Check if 3 consecutive odds exist

Arrays: Check If N and Its Double Exist

Arrays: Find unique numbers that sum upto zero

Arrays: Find numbers with even number of digits

 

 

===============================
Strings Questions
===============================

Strings: Group Anagrams in C++

Strings: Wildcard Matching

Strings: Simplify Path CPP

Strings: Given a 2D board and a word, find if the word exists in the grid.

Strings: check if the given string is valid or not explanation with solution

Strings: Decode Ways

Strings: Restore IP Addresses

Strings: Word Ladder

Strings: Given a string s, partition s such that every substring of the partition is a palindrome.

Strings: Given a sentence and maxWidth. Arrange the text in such a way that each line has exactly maxWidth characters and is fully justified.

Strings: You are given a sentence, reverse the string word by word

Strings: Given 2 strings, check if they are isomorphic strings.

Strings: You are given a string that contain a basic expression, calculate the result. Solution in C++.

Strings: Reverse a string

Strings: Print all the duplicates in a string

Strings: Program to check if strings are rotations of each other or not

Strings: Longest Repeating Subsequence

Strings: Given a string, print all the subsequence

Strings: Permutations of a given string

Strings: Divide binary string into sub strings with equal number of 0s and 1s.

Strings: Check balanced parenthesis

Strings: Word Break Problem

Strings: Convert a string into its mobile numeric keypad

Strings: Get the minimum number of inversions needed to make an expression balanced

Strings: Count the number of string in 2D character array

Strings: Convert Roman Numerals to Decimal

Strings: Longest Common Prefix

Strings: Minimum number of flips to make binary string alternate

Strings: Find the first repeated word in a string

Strings: Minimum swaps required for bracket balancing

Strings: Find the longest common subsequence between two strings.

Strings: Check if it is possible to re-arrange characters in a string, such a way that no two adjacent are same

Strings: Minimum characters to be added at beginning to make string palindrome

Strings: Remove all consecutive duplicates from the string

Strings: Find minimum operations required to transform a string into another string

Strings: Recursively print all sentences that can be formed from list of word lists

Strings: Remove all consecutive duplicates from the string

Strings: Given a string convert into its equivalent ASCII form

Strings: Second most repeated word in a sequence

Strings: Convert Postfix to Infix

Strings: Longest Prefix Suffix

Strings: Calculate the basic arithmetic expression as string

Strings: Calculate an expression with * and /

Strings: Given an encoded string, decode string

Strings: Number of Different Integers in a String

Strings: Longest Substring Of All Vowels in Order

Strings: Minimum Number of Swaps to Make the Binary String Alternating

Strings: Longer Contiguous Segments of Ones than Zeros

Strings: Check if Word Equals Summation of Two Words

 

===============================
BitMagic Questions
===============================

Bitwise Operators: Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.

Bitwise Operators: The gray code is a binary numeral system where two successive values differ in only one bit.

Bitwise Operators: Reverse Bits

Bitwise Operators: Count the number of set bits

Bitwise Operators: Power of 2

Bitwise Operators: Missing Number

Bitwise Operators: Counting set bits in a number

Bitwise Operators: Hamming Distance

Bitwise Operators: Bitwise and of number range

Bitwise Operators: Find the two non repeating numbers.

Bitwise Operators: Count number of bits to be flipped to convert A to B

Bitwise Operators: Bitwise Set bit questions

Bitwise Operators: Copy set bits in a range

Bitwise Operators: Power Set

 

===============================
Linked List Questions
===============================

Linked List: Given two non empty Linked List with non negative numbers, and numbers are stored in reverse order having single digit. Add the two list and return the result as a linked list. 

Linked List: Remove Nth Node from End of List 

Linked List: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.

Linked List: Swap Nodes in Pairs solution in C

Linked List: Merge k sorted linked lists and return it as one sorted list in C++

Linked List: Reverse Linked List iterative and recursive in C++

Linked List: Intersection of Two Linked Lists in c++

Linked List: Rotate linked list by k nodes

Linked List: Remove Duplicates from Sorted List solution in CPP

Linked List: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.

Linked List: Reverse a linked list from position m to n. Do it in one-pass.

Linked List: Given a linked list, determine if it has a cycle in it.

Linked List: Reorder list in to alternate nodes like first lowest and first highest.

Linked List: Sort a linked list using insertion sort.

Linked List: Given an unsorted linked list, sort the list using merge sort.

Linked List: Given a linked list, check if it is a palindrome or not. Solution in C++

Linked List: Reverse Linked List in groups

Linked List: Remove duplicates from an unsorted linked list

Linked List: Move last element to front of a given Linked List

Linked List: Add 1 to the linked list

Linked List: Find middle element in Linked List

Linked List: Split circular Linked List into two halves

Linked List: Program to Check if a Singly Linked List is Palindrome

Linked List: Deletion from a Circular Linked List

Linked List: Reverse a Doubly Linked List

Linked List: Find pairs with a given sum in a DLL.

Linked List: Count triplets in a sorted DLL whose sum is equal to given value “k”.

Linked List: Sort a “k”sorted Doubly Linked list

Linked List: Rotate Doubly linked list by N nodes

Linked List: Rotate a Doubly Linked list in group of Given Size

Linked List: Flatten a Linked List

Linked List: Multiply two numbers represented by Linked Lists

Linked List: Delete nodes which have a greater value on right side using recursion

Linked List: Segregate even and odd nodes in a Linked List

Linked List: Odd Even Linked List

 

 

 

 

 

 

===============================
Stack Questions
===============================

Stack: Given an expression in reverse polish notation, evaluate it and get the output in C++

Stack: C++ program to implement queue using stacks.

Stack: Implement two stacks in an array

Stack: Delete the middle element from the stack.

Stack: Check for balanced brackets using stack

Stack: Next Greater Element

Stack: Evaluate postfix expression

Stack: Insert at the end of stack

Stack: Reverse a stack using recursion

Stack: Sort a stack

Stack: Largest Rectangular Area in a Histogram

Stack: Length of the longest valid substring

Stack: Expression contains redundant bracket or not

Stack: Implement Stack using Queues

Stack: Check if a stack is a permutation of another stack

Stack: Queue Reversal

Stack: Reverse the first “K” elements of a queue

Stack: Next Smaller Element

Stack: Design a stack that returns the minimum element in constant time.

Stack: Get the min element of the stack in O(1) time

Stack: Get the next greater element in a circular array

Stack: Check if given 2 strings are same with backspace character

Stack: Remove outer most redundant parenthesis

Stack: Remove All Adjacent Duplicates In String

Stack: Build an Array With Stack Operations

Stack: Make digit minimum by removing k digits.

Stacks: Minimum Insertions to Balance a Parentheses String

Stacks: Check if the given pattern exist in the array

Stack: Score of Parentheses

Stacks: Validate stack operations

 

 

===============================
Searching and Sorting Questions
===============================

Searching and Sorting: Maximum and minimum of an array using minimum number of comparisons

Searching and Sorting: Search an array where adjacent differ by at most k

Searching and Sorting: Count all distinct pairs with difference equal to k

Searching and Sorting: Maximum sum such that no two elements are adjacent

Searching and Sorting: Merge 2 sorted arrays

Searching and Sorting: print all subarrays with 0 sum

Searching and Sorting: Product of array except itself.

Searching and Sorting: Sort Integers by The Number of 1 Bits

Searching and Sorting: Minimum number of swaps required to sort an array

Searching and Sorting: K-th Element of Two Sorted Arrays

Searching and Sorting: Find the missing number in Arithmetic Progression

Searching and Sorting: Factorial Trailing Zeroes

Searching and Sorting: Find the smallest and second smallest elements in an array

Searching and Sorting: Find the majority element in the array

 

===============================
Sorting Questions
===============================

===============================
Binary Searching Questions
===============================

Binary Search: Given an array sorted in ascending order and is rotated at some pivot, given a target value to search, if found in the array return its index

Binary Search: Search a 2D Matrix in C++

Binary Search: Binary search on an array that is in descending order

Binary Search: Order-Agnostic Binary Search

Binary Search: Find the first and last occurrence of an element

Binary Search: Find the number of times a Sorted array is Rotated

Binary Search: Searching in a Nearly Sorted Array

Binary Search: Find Floor of an element in a Sorted Array

Binary Search: Find Ceil of an element in a Sorted Array

Binary Search: Find position of an element in an Infinite Sorted Array

Binary Search: Find the index of first 1 in an infinite sorted array of 0s and 1s

Binary Search: Peak Element

Binary Search: Find maximum element in Bitonic Array

Binary Search: Search An Element in Bitonic Array

Binary Search: Get the rotation count in sorted rotated array

Binary Search: Count the number of 1’s in an array sorted in decreasing order.

Binary Search: Searching and Sorting: Get the fixed point in an array

 

===============================
Queue Questions
===============================

===============================
Matrix Matrix Questions
===============================

Matrix: You are given an n x n 2D matrix rotate it by 90 degrees (clockwise) in C++.

Matrix: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.

Matrix: Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order in C++

Matrix: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place.

Matrix: Search a 2D Matrix in C++

Matrix: Check if the given board is valid Sudoku or not explanation with solution in CPP

Matrix: Surrounded Regions

Matrix: Soduku Solver

Matrix: Given a 2d matrix, filled with 1 and 0. Find the maximum sub-matrix that has only 1’s and return the area.

Matrix: Find median in a row wise sorted matrix.

Matrix: Find a row with maximum number of 1’s in a binary matrix

Matrix: Kth smallest element in a sorted matrix

Matrix: Get the common elements in all row of a matrix.

Matrix: Find pair with maximum sum in the matrix.

 

 

 

 

===============================
Pattern Searching Matrix Questions
===============================

===============================
Recursion Questions
===============================

Recursion: Count the number of ways a baby can reach the n’th stair taking 1 or 2 steps at a time in C language. 

Recursion: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 

Recursion: Given a collection of distinct integers, return all possible permutations.

Recursion: Implement pow(x, n), which calculates x raised to the power n (xn) in C++

Recursion: Count the ways to decode a digit sequence

Recursion: Get the nth Fibonacci Number

Recursion: Get the least number of perfect squares

 

 

===============================
Heaps Questions
===============================

Heaps: Build Min Heap from an Array

Heaps: Sort an Array using heap

Heaps: Find kth smallest in an unsorted array

Heaps: Merge “K” sorted arrays

Heap: Kth smallest element.

Heap: Return k largest element

Heap: Sort a K sorted array or nearly sorted array

Heap: K closest number

Heap: Top K Frequent Elements

Heap: Frequency sort

Heap: Top K Frequent Words

Heap: Connect ropes with minimum cost

Heap: Sum of all the elements between k1 and k2 smallest elements

Heap: kth largest element in a stream

 

 

 

===============================
Hashing Questions
===============================

Hashing: Given an array of integers in ascending order, return index of the two numbers such that they add up to a specific key provided. 

 

 

 

===============================
Dynamic Programming Questions
===============================

Dynamic Programming: Longest Palindromic Substring In C++ 

Dynamic Programming: Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’. 

Dynamic Programming: Rain water trapping

Dynamic Programming: Unique Paths Solution in CPP

Dynamic Programming: Unique Paths 2

Dynamic Programming: Minimum Path Sum in CPP

Dynamic Programming: Longest Increasing Subsequence

Dynamic Programming: Longest Bitonic Subsequence

Dynamic Programming: Get Max Coin In Game problem.

Dynamic Programming: Rod Cutting Problem

Dynamic Programming: Box Stacking Problem

Dynamic Programming: Building Bridges

Dynamic Programming: Egg Dropping Problem

Dynamic Programming: Min Edit Distance

Dynamic Programming: 0 1 Knapsack Problem using Dynamic Programming

Dynamic Programming: Binomial Coefficiet Problem

Dynamic Programming: Permutation Coefficient

Dynamic Programming: Get the nth catalan number

Dynamic Programming: Subset sum problem

Dynamic Programming: Unbounded Knapsack Problem

Dynamic Programming: Equal Sum partition

Dynamic Programming: Climb the stairs with minimum cost

Dynamic Programming: Robbing Houses

Dynamic Programming: Get the sum by deleting elements from the array

Dynamic Programming: Count of subset sum with a given sum

Dynamic Programming: Minimum subset difference

Dynamic Programming: Target Sum

Dynamic Programming: Count the number of subset with a given difference

Dynamic Programming: Minimum Number of swaps to make array increasing

Dynamic Programming: Longest Common Subsequence

Dynamic Programming: Print Longest Common Sub-sequence

Dynamic Programming: Length of Shortest Common Supersequence

Dynamic Programming: Print Shortest Common Supersequence

Dynamic Programming: Minimum number of deletions and insertions to convert one string into another

Dynamic Programming: Longest repeating subsequence

Dynamic Programming: Check if one string is a subsequence of another

Dynamic Programming: Count how many times string 1 appears as substring in string 2.

Dynamic Programming: Longest Common Substring

Dynamic Programming: Get the count of delete operations on 2 strings.

 

 

 

===============================
Divide and conquer Questions
===============================

Divide and Conquer: Implement pow(x, n), which calculates x raised to the power n (xn) in C++

Dynamic Programming: Find the Maximum and minimum of an array

 

 

 

 

===============================
Backtracking Questions
===============================

Backtracking: Given an array of non repeating numbers and a key, find all the unique combinations in that array, where the sum of those combination is equal to the key.

Backtracking: Letter Combinations of a Phone Number

Backtracking: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.

Backtracking: Subsets II in CPP

Backtracking: Partition string into its palindrome

Backtracking: You are given an array with repeated elements and a key element, find all unique combination to the key

Backtracking: Get the k combination from an array of 1 to n

Backtracking: Find combination sum of k numbers that sum up to n

Backtracking: Letter case permutation

Backtracking: Get the sequential digits from the given range

Backtracking: Return the number of queens possible in a chessboard

Backtracking: Partition to K Equal Sum Subsets

Backtracking: Get maximum sum in a matrix

 

 

 

 

 

 

===============================
Binary Trees Questions
===============================

Binary Trees: Get difference between values at Even and Odd level in a binary tree

Binary Tree: Get Number of Nodes in a Binary Tree

Binary Tree: Display nodes at given level in Binary Tree

Binary Tree: Display Reverse Level Order Traversal by using queue

Binary Tree: Perform PreOrder traversal on a Binary Tree by without Recursion

Binary Tree: Perform InOrder traversal on a Binary Tree by without Recursion

Binary Tree: Perform PostOrder traversal on a Binary Tree by without Recursion

Binary Tree: Convert a binary tree to its Mirror Tree

Binary Tree: Check if Two Trees are Mirror Structure to each other

Binary Tree: Delete a binary tree

Binary Tree: Get Level of a Given Node

Binary Tree: Get Sum of elements Level wise in a Binary Tree

Binary Tree: Get Maximum width of Binary Tree

Binary Tree: Display elements between any two given level

Binary Tree: Check if binary tree is a height balanced tree?

Binary Tree: Check if all Leaf Nodes are at same level in Binary tree

Binary Tree: Find Parent of a given node value in Binary Tree

Binary Tree: Check if given Binary Tree is BST

Binary Tree: Find Sibling node of a given node value in Binary Tree

Binary Tree: Check if given two nodes are siblings to each other in Binary Tree

Binary Tree: Get Sum of all nodes formed from Root to Leaf Path

Binary Tree: Get Average of all nodes in Binary Tree

Binary Tree: Get Sum of all Leaf Nodes in Binary Tree

Binary Tree: Find Maximum or Minimum in Binary Tree

Binary Tree: Check if Binary Tree is Foldable Tree

Binary Tree: Check if two Binary Trees are Isomorphic

Binary Tree: Get Vertical Sum of Binary Tree

Binary Tree: Get deepest Left Leaf Node in Binary Tree

Binary Tree: Get depth of Odd level which contains Leaf node in Binary Tree

Binary Tree: Display all the leaf nodes from left to right and right to left in a tree

Binary Tree: Get count Non-Leaf nodes in a Binary Tree

Binary Tree: Get the count full nodes in a Binary

Binary Tree: Bottom view of binary Tree

Binary Tree: Boundary Traversal of Binary Tree

Binary Tree: Top view of a binary tree

Binary Tree: Left view and right view of a Binary Tree

Binary Tree: Level Order Traversal

Binary Tree: Vertical Order Traversal

Binary Tree: Height or Max depth if a BTree

Binary Tree: Spiral order or Zigzag traversal of a Binary Tree

Binary Tree: Diameter of a Binary Tree

Binary Tree: Lowest Common ancestor of a Binary Tree.

Binary Tree: Check if 2 nodes are mirror of each other

Binary Tree: Check if 2 binary tree are identical

Binary Tree: Check if binary tree is a sum tree

Binary Tree: Add all the node values in a Binary Tree or Sum of a Binary tree

Binary Tree: Print the number of leaf nodes in a binary tree

Binary Tree: Print all the paths from root node to leaf node

Binary Tree: Print the nodes at k distance from the root of a binary tree

Binary Trees: Diagonal Traversal of a Binary tree

Binary Trees: Convert Binary Tree to DLL

Binary Trees: Convert Binary tree into Sum tree

Binary Trees: Construct Binary Tree from preorder and inorder traversal

Binary Trees: Minimum swap required to convert binary tree to binary search tree

Binary Trees: Find Duplicate Subtrees

Binary Trees: Check if a given graph is tree or not

Binary Trees: Find largest subtree sum in a tree

Binary Trees: Maximum Sum of nodes in Binary tree such that no two are adjacent

Binary Trees: Kth Ancestor of a Tree Node

Binary Trees: Find Duplicate Subtrees

 

 

 

===============================
Graph Questions
===============================

Graph: Detect a cycle in a directed graph

Graph: Detect a cycle in a undirected graph

Graph: Check if the given edge is a bridge in the graph

Graph: Check if undirected graph is connected or not

Graph: Count the number of connected components in an undirected graph

Graph: Reverse a directed graph

Graph: Given a directed graph, check if the incoming edges of a vertex is equal to the vertex itself.

Graph: Check if the undirected graph is a tree or not

Graph: Given an directed graph, find the in and out degree of all vertices

Graph: Find there is a path between 2 nodes in a directed graph

Graph: Get the maximum sum of values of nodes among all connected components of an undirected graph

Graph: Get the unique lengths of connected components of an undirected graph.

Graph: Find if there is a path between 2 nodes in an undirected graph

Graph: Check if a graph is a strongly connected using Kosaraju DFS algorithm

Graph: Dice Sum Problem

 

===============================
Binary Search Trees Questions
===============================

Binary Search Trees: Find a value in a BST

Binary Search Trees: Deletion of a node in a BST

Binary Search Trees: Find min and max value in a BST

Binary Search Trees: Find the Inorder predecessor and successor for a given key in BST

Binary Search Trees: A program to check if a binary tree is BST or not

Binary Search Trees: Convert a BST into greater sum tree

Binary Search Trees: LCA in a BST

Binary Search Trees: Construct BST from preorder traversal

Binary Search Trees: Convert Binary Tree into Binary Search Tree.

Binary Search Trees: Convert a normal BST into a Balanced BST

Binary Search Trees: Merge Two balanced BST

Binary Search Trees: Kth Largest Element in a BST

Binary Search Trees: Kth smallest Element in a BST

Binary Search Trees: Return the sum of given range in BST.

Binary Search Trees: Get the Shortest distance between two nodes in BST

Binary Search Trees: Count the number of BST nodes that lie in a given range.

Binary Search Trees: Convert sorted DLL to Balanced BST

Binary Search Trees: Find triplet sum in BST

Binary Search Trees: Check if the pre-order is a valid BST

Binary Search Trees: Check if the BST has a dead end

Binary Search Trees: Correct a BST where 2 nodes are swapped

Binary Search Trees: Flatten BST to sorted list

Binary Search Tree: Unique Binary Search Trees

 

 

===============================
Greedy Questions
===============================

Greedy: Remove duplicates from a string

Greedy: Add elements in an array so the sum is equal to the given range

Greedy: Remove k digits from an number to make it a smallest integer.

Greedy: Get the minimum platforms needed to avoid delay in the train arrival.

Greedy: Check if the string is a substring of another string

Greedy: Remove overlapping intervals.

Greedy: Plant n flowers in flower bed

Greedy: Maximum meetings in one room

Greedy: Distribute Candy

Greedy: Schedule task efficiently

Greedy: Shuffle array so that one array element is greater than other array element

Greedy: Maximum sum of absolute difference of an array

Greedy: Partition characters

Greedy: Juice change

Greedy: Given a string, split into balanced strings.

Greedy: Perform operations on a broker calculator

Greedy: Add minimum to make parentheses valid.

Greedy: Remove covered intervals.

Greedy: Reduce the array size to the half

Greedy: String break problem

Greedy: Connect ropes with minimum cost.

Greedy: Find maximum sum possible equal sum of three stacks

 

 

 

 

===============================
2 pointers Questions
===============================

Two Pointers: Given an array, find 3 elements such that [a + b + c] = 0. Find all the 3 unique elements. 

Two Pointers: Given an array of n integers and an integer “key”, find three integers in the array such that the sum is closest to key. 

Two Pointers: Given an array n integers and an integer key, are there four elements a, b, c, and d in the array such that a + b + c + d = key? Find all unique quadruplets in the array which gives the sum of key. 

Two Pointers: Rain water trapping

Two Pointers: Reverse an array

Two Pointers: Arrays: Given an array find the duplicate number

Two Pointers: Arrays: Minimum swaps required to bring all elements less than or equal to k together

Two Pointers: Arrays: Get minimum number of merge operations to make an array palindrome

===============================
Sliding Window Questions
===============================

Sliding Window: Strings: Smallest distinct window

Sliding Window: Strings: Minimum Window Substring