## Number of ways to get a given sum with n number of m-faced dices

Given n dices each with m faces, numbered from 1 to m, find the number of ways to get a given sum X. X is… Read More »

- Sum of XOR of all subarrays
- Check if a word exists in a grid or not
- Optimal Strategy for a Game | Set 2
- 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)
- Double Knapsack | Dynamic Programming
- 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
- Bellman Ford Algorithm (Simple Implementation)
- Longest path in a directed Acyclic graph | Dynamic Programming
- Minimum number of cubes whose sum equals to given number N
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Maximum sum such that no two elements are adjacent | Set 2
- Minimum steps required to convert X to Y where a binary matrix represents the possible conversions
- Find sub-matrix with the given sum
- Maximum subarray sum by flipping signs of at most K array elements
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- DP on Trees | Set-3 ( Diameter of N-ary Tree )
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Count of Numbers in Range where first digit is equal to last digit of the number
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Minimum steps to delete a string by deleting substring comprising of same characters
- Count number of ways to reach a given score in a Matrix
- Maximum sum path in a matrix from top to bottom and back
- LCA in a tree using Binary Lifting Technique
- Number of ways of scoring R runs in B balls with at most W wickets
- Sum of bitwise AND of all submatrices

Given n dices each with m faces, numbered from 1 to m, find the number of ways to get a given sum X. X is… Read More »

Given a string str, the task is to find the number of odd length palindromic sub-sequences around of str with str[i] as centre i.e. every… Read More »

Given an array arr[] of N elements. The task is to find the number of sub-sequences which have at least two consecutive elements such that… Read More »

Given an array arr[] of size N, the task is to generate and print all permutations of the given array. Examples: Input: arr[] = {1,… Read More »

Given an integer array ‘arr’ of length N and an integer ‘k’, select some non-overlapping subarrays such that each sub-array if of length at most… Read More »

Given an array arr[] of size N, the task is to generate and print all possible combinations of R elements in array. Examples: Input: arr[]… Read More »

Given an array arr[] of N integers, the task is to find the longest sub-sequence in the given array such that for all pairs from… Read More »

Given an array of N elements. Find the subset of elements which has maximum sum such that no two elements in the subset has common… Read More »

Given an array arr[] of N integers and an integer K. The task is to find the number of ways to select one or more… Read More »

Given an array ‘arr’ consisting of integers, the task is to find the non-empty subset such that its sum is closest to zero i.e. absolute… Read More »

A trip to mystical land is going to be organized in ByteLand, the city of Bytes. Unfortunately, there are limited seats say A and there… Read More »

Given an integer array W[] consisting of weights of items and ‘K’ knapsacks of capacity ‘C’, find maximum weight we can put in the knapsacks… Read More »

Given an integer array W[] consisting of weights of the items and some queries consisting of capacity C of knapsack, for each query find maximum… Read More »

Given three arrays A[], B[] and C[] of same size N. The task is to minimize the sum after choosing N elements from these array… Read More »

Given an integer array arr[] of length N and an integer K, the task is to select some non-overlapping sub-arrays such that each sub-array is… Read More »