Skip to content

Category Archives: Strings

Given an array arr[] consisting of N binary strings, and two integers A and B, the task is to find the length of the longest… Read More
Given an array arr[] consisting of N strings, the task is to find the maximum product of length of the strings arr[i] and arr[j] for… Read More
Given a 2D array of strings arr[][4], representing the scores of M football matches played in a tournament involving N teams, the task is to… Read More
Given a string S consisting of N lowercase alphabets, the task is to check if it is possible to split the string S into three… Read More
Given a binary string S, the task is to print all distinct decimal numbers that can be obtained by generating all permutations of the binary… Read More
Given a string S representing a sentence, the task is to reverse the order of all palindromic words present in the sentence. Examples: Input: S… Read More
Given a string S, the task is to print permutations of all words in a sentence. Examples: Input: S = “sky is blue”Output:  sky is… Read More
Given a string S representing a sentence, the task is to reorder all the palindromic words present in the sentence in sorted order. Examples: Input:… Read More
Given a string S of length N consisting only of characters ‘a’, ‘b’, and ‘c’, the task is to minimize the length of the given… Read More
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
Given a string S consisting of N lowercase alphabets, the task is to modify the string S by replacing each character by the alphabet whose… Read More
Given a binary string S of length N and a positive integer M, the task is to check if it is possible to rotate the… Read More
Given a positive integer N, the task is to generate a random binary string of length N. Examples: Input: N = 7Output: 1000001 Input: N… Read More
Given a string S consisting of N lowercase alphabets, the task is to check if all the strings of at least length 2 formed by… Read More