## Generate all unique partitions of an integer | Set 2

Given a positive integer n, the task is to generate all possible unique ways to represent n as sum of positive integers. Examples: Input: 4… Read More »

- Check if a word exists in a grid or not
- Sum of XOR of all subarrays
- Minimum steps to reach any of the boundary edges of a matrix | Set 1
- Longest subsequence such that adjacent elements have at least one common digit
- Make Binary Search Tree
- Samsung Interview Experience through Co-cubes (2019)
- Minimum distance to the end of a grid from source
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Double Knapsack | Dynamic Programming
- Minimum steps required to convert X to Y where a binary matrix represents the possible conversions
- Longest path in a directed Acyclic graph | Dynamic Programming
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- Maximum subarray sum by flipping signs of at most K array elements
- Count of Numbers in Range where first digit is equal to last digit of the number
- Optimal Strategy for a Game | Set 2
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Bellman Ford Algorithm (Simple Implementation)
- Find sub-matrix with the given sum
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Minimum steps to delete a string by deleting substring comprising of same characters
- Count of sub-sets of size n with total element sum divisible by 3
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Count number of ways to reach a given score in a Matrix
- Sum of bitwise AND of all submatrices
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Number of Binary Strings of length N with K adjacent Set Bits
- DP on Trees | Set-3 ( Diameter of N-ary Tree )
- Find the sum of the diagonal elements of the given N X N spiral matrix
- Number of ways of scoring R runs in B balls with at most W wickets

Given a positive integer n, the task is to generate all possible unique ways to represent n as sum of positive integers. Examples: Input: 4… Read More »

Given an N * N matrix mat[][] consisting of non-negative integers and some queries consisting of top-left and bottom-right corner of the sub-matrix, the task… Read More »

Given an array arr[] of N and Q queries consisting of a range [L, R]. the task is to find the bit-wise AND of all… Read More »

Given an array arr[] of N and Q queries consisting of a range [L, R]. the task is to find the bit-wise OR of all… Read More »

Given a string str of lowercase alphabets, the task is to find all distinct palindromic sub-strings of the given string. Examples: Input: str = “abaaa”… Read More »

Given an array of positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be… Read More »

Given an integer array arr[] of length N consisting of positive integers, the task is to minimize the number of steps required to reach the… Read More »

Given an N * N matrix arr[][] consisting of non-negative integers, the task is to find the number of ways to reach arr[N – 1][N… Read More »

Given a 2d-matrix consisting of positive integers, the task is to find the minimum number of steps required to reach the end of the matrix.… Read More »

Given a 2d-matrix consisting of positive integers, the task is to find the minimum number of steps required to reach the end(leftmost-bottom cell) of the… Read More »

Problem statement: Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against an… Read More »

Given a binary string str. The task is to find the smallest positive integer C such that the binary string can be cut into C… Read More »

Given a matrix of dimension N * M. The task is find the maximum sum of path from arr[0][0] to arr[N – 1][M – 1]… Read More »

We have introduced Bellman Ford and discussed on implementation here. Input: Graph and a source vertex src Output: Shortest distance to all vertices from src.… Read More »