Skip to content

Category Archives: Strings

Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More
Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More
Given 2 times ‘st‘ and ‘et‘ in HH: MM: SS format. The task is to print the time difference between st and et in HH:MM:… Read More
Given an integer X and two strings S1 and S2, the task is to check that string S1 can be converted to the string S2… Read More
Given two strings A and  B, the task is to find the shortest string which is some multiple of both A and B. A string… Read More
Given a binary string str, the task is to find its equivalent ASCII character string. Examples:  Input: str = “0110000101100010”Output: abExplanation: Dividing str into set of 8… Read More
Given a binary array arr[] containing N integer elements, the task is to create a string s which contains all N elements at the same… Read More
Given two strings A and B having lower case English alphabets, the task is to find the number of operations required to convert string A… Read More
Given a string str, the task is to find the minimum number of moves required to reach lexicographically largest and smallest characters. In one move,… Read More
Given two strings s1 and s2, check whether s2 is a rotation of s1. Examples:  Input : ABACD, CDABA Output : True Input : GEEKS, EKSGE… Read More
Given two strings s1 and s2, check whether s2 is a rotation of s1. Examples:  Input : ABACD, CDABA Output : True Input : GEEKS, EKSGE… Read More
Given two strings s1 and s2, check whether s2 is a rotation of s1. Examples:  Input : ABACD, CDABA Output : True Input : GEEKS, EKSGE… Read More
Given two strings s1 and s2, check whether s2 is a rotation of s1. Examples:  Input : ABACD, CDABA Output : True Input : GEEKS, EKSGE… Read More
Given a string str, the task is to perform the following type of queries on the given string:   (1, K): Left rotate the string by… Read More
Given a string str, the task is to perform the following type of queries on the given string:   (1, K): Left rotate the string by… Read More