Skip to content

Tag Archives: subsequence

Given an array of integers, find a number of subsequences such that the sum of the subsequence is divisible by m. It is given that… Read More
Given a non-empty string S containing only lowercase letters, print all ‘Special Subsequences’ of S. For Instance, “ab” has the following Special Subsequences-: { “A”,… Read More
Given two numbers X and d where X represents the number of non empty subsequences and d represents the difference. Output an array of size… Read More
Given a string of length n of capital letters. The task is to find the count of ‘GFG’ subsequence in the given string. Examples: Input… Read More
Given a string S of only small English letters. We need to transform the string by making some number of moves (any number of times)… Read More
Given a number as string s, find the sum of all the elements present in all possible subsequences of s. Examples : Input : s… Read More
Given a string ‘s’ and an integer k, find other string ‘t’ such that ‘t’ is the largest subsequence of given string ‘s’ and each… Read More
Given two strings, find the length of longest uncommon subsequence of the two strings. The longest uncommon subsequence is defined as the longest subsequence of… Read More
Given two strings str1 and str2 of length n1 and n2 respectively. The problem is to count all the subsequences of str1 which are anagrams… Read More
Given two strings str1 and str2 of length n1 and n2 respectively. The problem is to find the length of the longest subsequence which is… Read More
Given two strings A and B, the problem is to find if string B will be a subsequence of string A if we remove the… Read More
Given an arr of size n. The problem is to count all the subsequences having maximum number of distinct elements. Examples: Input : arr[] =… Read More
Given a string of length n and a subsequence of length 3. Find the total number of occurrences of the subsequence in this string. Examples… Read More
Given an array of size n. The problem is to find the length of the subsequence in the given array such that all the elements… Read More