Skip to content

Category Archives: Strings

Given string str having N characters representing an integer, the task is to calculate the sum of all possible prefixes of the given string. Example:… Read More
Given a string S consisting of uppercase and lowercase letters, the task is to check if uppercase characters are used correctly in the given string… Read More
Given string str of size N consisting of lowercase English alphabets, the task is to encode the given string as follows: change every character of… Read More
Given three binary strings a, b, and c each having 2*N characters each, the task is to find a string having almost 3*N characters such… Read More
Given two strings A and B each of length N and an integer K, the task is to find if string A can be converted… Read More
Given string str, the task is to find the frequency of all digits (0-9) in a string created by concatenating the ASCII values of each… Read More
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation.… Read More
Given two strings S and T of lengths n and m respectively. Find the maximum adjacent index difference for the indices where string T is… Read More
Given a binary string str of length N, the task is to count the maximum number of adjacent pairs of form “01” or “10” that… Read More
String class stores the characters as a sequence of bytes with the functionality of allowing access to the single-byte character. There are several ways to… Read More
Given string str, the task is to check if this string str consists of valid English words or not. A string is known as a… Read More
Given a string str and an array of words word[], the task is to find whether str is a prefix string of word[]. Examples: Input:… Read More
Given a string S of length N and a positive integer K, the task is to find the minimum total cost of picking K unique… Read More
Given a string str of length N. The task is to print the frequency of adjacent repeating characters.  Examples: Input: str = “Hello”Output: l: 2Explanation:… Read More
Given a string str of size N, the task is to find the suffix array of the given string. Note: A suffix array is a… Read More

Start Your Coding Journey Now!