Given string S of size N, the task is to find the single-digit sum by the repetitive sum of digits of the value obtained by… Read More
Category Archives: Strings
Given a string of lowercase letters S a character c. The task is to find minimum K such that every substring of length K contains… Read More
Given a string str, find the length of the longest substring without repeating characters. For “ABDEFGABEF”, the longest substring are “BDEFGA” and “DEFGAB”, with length… Read More
Given a string S of N characters, the task is to calculate the total number of non-empty substrings such that at most one character occurs… Read More
Given a string S of size N, the task is to sort the string based on their ASCII values. Examples: Input: S = “Geeks7”Output: 7GeeksExplanation:… Read More
Given a binary string S of size N and an array arr[] of M integers, the task is to find the final string after flipping… Read More
Given a string S and a positive integer K, the task is to find the number of subsequences “01” in the string generated by concatenation… Read More
Given a string S of N characters consisting of ‘?’, ‘0‘, and ‘1‘ and two integers a and b, the task is to find a… Read More
Given an array arr[] of N integers and a positive integer K, the task is to choose K integers from the array arr[] such that… Read More
Given an array arr[] of N strings consisting of lowercase alphabets, the task is to find the number of distinct groups of strings formed after… Read More
Given an array of strings words[] and the sequential order of alphabets, the task is to sort the array according to the given order. Assume… Read More
Given a positive integer N, the task is to generate a lexicographically smallest numeric string of size N having an odd count of each digit.… Read More
Given string str of size N consisting of only 0, 1, and 2, the task is to find the number of substrings that consists of… Read More
Given a binary string S of size N, the task is to find the number of minimum adjacent swaps required to make the string alternate.… Read More
Given a vector of numeric strings arr[], the task is to sort the given vector of numeric strings in ascending order. Examples: Input: arr[] =… Read More