## Find minimum length sub-array which has given sub-sequence in it

Given an array arr[] of N elements, the task is to find the length of the smallest sub-array which has sequence {0, 1, 2, 3,… Read More »

- Optimal Strategy for a Game | Set 2
- Samsung Interview Experience through Co-cubes (2019)
- Maximum sum such that no two elements are adjacent | Set 2
- Bellman Ford Algorithm (Simple Implementation)
- Longest subsequence such that adjacent elements have at least one common digit
- Double Knapsack | Dynamic Programming
- Coin Change | BFS Approach
- Minimum time required to rot all oranges | Dynamic Programming
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Longest path in a directed Acyclic graph | Dynamic Programming
- Number of subsets with zero sum
- Minimum number of cubes whose sum equals to given number N
- Maximum sum combination from two arrays
- Count of integers of length N and value less than K such that they contain digits only from the given set
- LCA in a tree using Binary Lifting Technique
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Maximize the happiness of the groups on the Trip
- Count number of ways to reach a given score in a Matrix
- Maximum Sum Subsequence of length k
- Maximum sum path in a matrix from top to bottom and back
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Distinct palindromic sub-strings of the given string using Dynamic Programming
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Greedy approach vs Dynamic programming
- Maximum subarray sum by flipping signs of at most K array elements
- Iterative approach to print all permutations of an Array
- Divide the array in K segments such that the sum of minimums is maximized
- 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
- Number of ways to choose elements from the array such that their average is K

Given an array arr[] of N elements, the task is to find the length of the smallest sub-array which has sequence {0, 1, 2, 3,… Read More »

Given a set of digits A[] in sorted order and two integers N and K, the task is to find how many numbers of length… Read More »

Given the mobile numeric keypad. You can only press buttons that are up, left, right or down to the current button or can choose to… Read More »

Given a sequence of positive integers of length N. The only operation allowed is to insert a single integer of any value at any position… Read More »

Given a matrix of dimension m * n where each cell in the matrix can have values 0, 1 or 2 which has the following… Read More »

Given an integer X and an array arr[] of length N consisting of positive integers, the task is to pick minimum number of integers from… Read More »

Given a binary string S, consisting of 0’s and 1’s. You have to accommodate the 0’s and 1’s into the K buckets in such a… Read More »

Given an array of positive elements, you have to flip the sign of some of its elements such that the resultant sum of the elements… Read More »

Given two integers L and R denoting a range [L, R]. The task is to find the total count of numbers in the given range… Read More »

Given an array arr[] of integers, the task is to find the maximum sum of any sub-sequence in the array such that any two adjacent… Read More »

Given an array p[] of odd length N where p[i] denotes the probability of getting a head on the ith coin. As the coins are… Read More »

Given infinte number of elements of form and ( n >= 0 ). The task is to find the minimum count of elements chosen such… Read More »

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 »