## Iterative approach to print all permutations of an Array

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 »

- 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 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 »

Given a 2D matrix arr[][] of dimensions N * M where N is number of rows and M is number of columns.The task is to… Read More »

Given a maze which is a N * N grid grid[][]. Every cell of the maze contains either the number 1, 2 or 3 which… Read More »

Given a 2d-matrix mat[][] consisting of positive integers, the task is to find the maximum score we can reach if we have to go to… Read More »