Given a positive integer N, the task is to print the nearest power of 2 of the frequencies of each digit present in N. If… Read More

# Category Archives: Strings

Given two strings S and T of length N and M respectively, the task is to find the smallest string that is divisible by both… Read More

Given a string S consisting of characters 0, 1, and ‘?’, the task is to count all possible combinations of the binary string formed by… Read More

Given circular binary string S of size N, the task is to count the minimum number of consecutive 0s required to be removed such that… Read More

Given an integer N and a binary string consisting of 4*N number of 0s initially, the task is to flip the characters such that any… Read More

Given a binary string S, the task is to find the minimum number of characters required to be removed from S, such that all the… Read More

Given two binary strings S1 and S2 of size N and M respectively, the task is to find the minimum number of reversal of substrings… Read More

Given an array arr[][2] consisting of N pair of strings representing the starting and ending time (in 12 hours format) and a string P which… Read More

Given a string S containing lowercase English alphabets, and a matrix shift[][] consisting of pairs of the form{direction, amount}, where the direction can be 0… Read More

Given two strings S and N of the same length, consisting of alphabetical and numeric characters respectively, the task is to generate a new string… Read More

Given a string S consisting of digits [0 – 9] and lowercase alphabets, the task is to calculate the sum of all numbers represented by… Read More

Given an array arr[] of size N and a string S, the task is to modify given array by removing all characters from their hexadecimal… Read More

Given a string S consisting of space-separated integers, the task is to write a C program to take the integers as input from the string… Read More

Given a string S representing a sequence of moves(L, R, U, and D) and two integers X and Y representing the starting coordinates, the task… Read More

Given a string S, the task is to find the resultant smallest string possible, formed by repeatedly removing pairs of adjacent characters which are equal.… Read More