C++ provides us a facility using which one can represent a sequence of characters as an object of a class. This class is std::string. Internally,… Read More
Category Archives: Strings
Given a string Str of N characters and two strings S1 and S2 of equal length where S1[i] and S2[i] are related to each other,… Read More
Given an array of strings arr[] of size N and an encrypted string str, the task is to find the correct string from the given… Read More
Given a string str of N characters, the task is to find the lexicographically smallest string that can be formed by concatenating any prefix and… Read More
Given two strings A and B, print the minimum number of slices required in A to get another string B. In case, if it is… Read More
Given a binary string S consisting of 0’s and 1’s, The task is to find the minimum number of flips required to generate a binary… Read More
Design a program to take a sentence as an input, and then encode it into Pig Latin. A Pig Latin is an encrypted word in… Read More
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… Read More
Given a string str of length N (divisible by 3) consisting of atmost three distinct characters, the task is to find the length of the… Read More
Given binary string str, the task is to choose any index and change into 0 or 1, and do this in minimum steps such that… Read More
Given a string S[], the task is to check whether the given string is a tautogramic sentence or not. A sentence is a tautogram if… Read More
Given a string str[] of length N of lowercase characters containing 0 or more vowels, the task is to find the count of vowels that… Read More
Given an encoded (or encrypted) string S of length N, an integer M. The task is to decrypt the encrypted string and print it. The… Read More
Given a binary string str. The task is to find the size of the set(contains unique substrings) of substrings such that if there is a… Read More
A string is a collection of characters. For example, “GeeksforGeeks” is a string. C++ provides primitive data types to create a string. The string can… Read More