Find index of the element differing in parity with all other array elements
Given an array arr[] of size N (N > 3), the task is to find the position of the element that differs in parity (odd/even) with respect to all other array elements. Note: It is guaranteed that there will always be a number that differs in parity from all other elements....
read more
Count of pairs in Array with difference equal to the difference with digits reversed
Given an array arr[] of N integers, the task is to find the number of pairs of array elements (arr[i], arr[j]) such that the difference between the pairs is equal to the difference when the digits of both the numbers are reversed....
read more
Minimum number of swaps required such that a given substring consists of exactly K 1s
Given a binary string S of size N and three positive integers L, R, and K, the task is to find the minimum number of swaps required to such that the substring {S[L], .. S[R]} consists of exactly K 1s. If it is not possible to do so, then print “-1”....
read more
Capitalize 1st character of all words having at least K characters
Given string str representing a sentence, and an integer K, the task is to capitalize all the words in the given sentence having at least K characters....
read more
Python program to remove words that are common in two Strings
Given two strings S1 and S2, representing sentences, the task is to print both sentences after removing all words which are present in both sentences....
read more
Map every character of one string to another such that all occurrences are mapped to the same character
Given two strings s1 and s2, the task is to check if characters of the first string can be mapped with the character of the second string such that if a character ch1 is mapped with some character ch2 then all the occurrences of ch1 will only be mapped with ch2 for both the strings....
read more
Find digits present in given jumbled String
Given a string s of length N, containing digits written in words but in jumbled form, the task is to find out the digits present in the string in word form and arrange them in sorted order....
read more
Minimum characters to be replaced in given String to make all characters same
Given a string str of size N consisting of lowercase English characters, the task is to find the minimum characters to be replaced to make all characters of string str same. Any character can be replaced by any other character....
read more
Longest Non-Increasing Subsequence in a Binary String
Given a binary string S of size N, the task is to find the length of the longest non-increasing subsequence in the given string S....
read more
Print all Strings from array A[] having all strings from array B[] as subsequence
Given two arrays A[] and B[] consisting of strings, the task is to print the strings from array A[] having all strings in B[] as a subsequence.Examples:...
read more
Length of longest common prefix possible by rearranging strings in a given array
Given an array of strings arr[], the task is to find the length of the longest common prefix by rearranging the characters of each string of the given array....
read more
Check if a string can be split into two substrings with equal number of vowels
Given a string S, the task is to check if the string can be split into two substrings such that the number of vowels in both of them are equal. If found to be true, then print “Yes”. Otherwise, print “No”....
read more