Print all possible K-length subsequences of first N natural numbers with sum N
Given two positive integers N and K, the task is to print all possible K-length subsequences from first N natural numbers whose sum of elements… Read More »
Given two positive integers N and K, the task is to print all possible K-length subsequences from first N natural numbers whose sum of elements… Read More »
Given an array arr[] consisting of N unique elements, the task is to generate an array B[] of length N such that B[i] is the… Read More »
Given a binary string, str, the task is to empty the given string by minimum number of removals of a single character or a subsequence… Read More »
Given a string str, consisting of lowercase alphabets, the task is to find the shortest string which is not a subsequence of the given string.… Read More »
Given two arrays arr1[] and arr2[] of length M and N consisting of digits [0, 9] representing two numbers and an integer K(K ≤ M… Read More »
Given an array arr[] of size N, the task is to count the number of longest increasing subsequences present in the given array. Examples: Input:… Read More »
Given an array arr[] of length N, the task is to find the Bitwise OR of the sum of all possible subsequences from the given… Read More »
Given an array arr[], the task is to find the length of the longest subsequence of the array arr[] such that all adjacent elements in… Read More »
C++ filter_none edit close play_arrow link brightness_4 code // C++ program of the // above approach #include <cstring> #include <iostream> using namespace std;… Read More »
Given two strings S1 and S2, the task is to check if it’s possible to generate string S2 by repeatedly appending subsequences of S1 to… Read More »
Given two arrays arr[] and arr1[] of lengths N and M respectively, the task is to find the longest increasing subsequence of array arr[] such… Read More »
Given a string S of length N, the task is to find the lexicographically smallest subsequence of length (N – 1), i.e. by removing a… Read More »
Given an array arr[] consisting of N positive integers, the task is to find the maximum length of subsequence from the given array such that… Read More »
Given an array arr[] consisting of N positive integers, and an integer K, the task is to find the maximum possible even sum of any… Read More »
Given an array arr[] of size N, the task is to find the maximum sum of a subsequence formed by concatenating disjoint subarrays whose lengths… Read More »