## Sum of XOR of all subarrays

Given an array containing N positive integers, the task is to find the sum of XOR of all sub-arrays of the array. Examples: Input :… 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)
- Optimal Strategy for a Game | Set 2
- 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
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Count of Numbers in Range where first digit is equal to last digit of the number
- Bellman Ford Algorithm (Simple Implementation)
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Find sub-matrix with the given sum
- Maximum sum such that no two elements are adjacent | Set 2
- Minimum steps to delete a string by deleting substring comprising of same characters
- 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
- Count of sub-sets of size n with total element sum divisible by 3
- DP on Trees | Set-3 ( Diameter of N-ary Tree )
- Sum of bitwise AND of all submatrices
- Find the sum of the diagonal elements of the given N X N spiral matrix
- 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

Given an array containing N positive integers, the task is to find the sum of XOR of all sub-arrays of the array. Examples: Input :… Read More »

Given an N-ary tree T of N nodes, the task is to calculate the longest path between any two nodes(also known as the diameter of… Read More »

Given an array arr[], the task is to find the maximum length of a subsequence such that the adjacent elements in the subsequence have a… Read More »

Given a string of ‘0’, ‘1’ and ‘2’. The task is to find the minimum number of replacements such that the adjacent characters are not… Read More »

Given an N x N matrix and two integers S and K, the task is to find whether there exists a K x K sub-matrix… Read More »

Given an integer n and a range [l, r], the task is to find the count of total sub-sets of size n with integers from… Read More »

Given an array arr[] of size N. The task is to find whether it is possible to make Binary Search Tree with the given array… Read More »

Given N number of boxes arranged in a row and M number of colors. The task is to find the number of ways to paint… Read More »

A variation of rat in a maze. You are given an N * N 2-D matrix shaped maze (let’s call it M), there is a… Read More »

Given numbers in form of an Inverted triangle. By starting at the bottom of the triangle and moving to adjacent numbers on the row above,… Read More »

Given an array arr[] of n elements and a number K, find the number of ordered subsets of arr[] having XOR of elements as K… Read More »

Given N seconds. The task is to check if it is possible to start from 12’0 clock and get back to 12 only adding or… Read More »

Given a matrix M of order N*M where Mij represent the occurrence of j in row i. The task is to find the probability of… Read More »

Given a Large number N ( number of digits in N can be up to 105). The task is to find the cuts required of… Read More »

Given a binary matrix of size NxN where 1 denotes that the number i can be converted to j, and 0 denotes it cannot be… Read More »