Given two strings string1 and string2, find the smallest substring in string1 containing all characters of string2 efficiently. For Example: Input : string = “this… Read More »
Given an input string, write a function that returns the Run Length Encoded string for the input string.
Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”… Read More »
There is a list of items. Given a specific word, e.g., “sun”, print out all the items in list which contain all the characters of… Read More »
Given a string, find the first non-repeating character in it. For example, if the input string is “GeeksforGeeks”, then output should be ‘f’ and if… Read More »
Difficulty Level: Rookie Question: Write a program to print N equal parts of a given string.
A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More »
Write a recursive C function to print reverse of a given string.
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1 using only one call to… Read More »
Write an efficient C function that takes two strings as arguments and removes the characters from first string which are present in second string (mask… Read More »
Algorithm: Let input string be “geeksforgeeks”
1: Construct character count array from the input string.
count[‘e’] = 4
count[‘g’] = 2
count[‘k’] = 2
2: Print all the indexes from the constructed array which have value greater than 0.
Below are the different methods to remove duplicates in a string.
Write an efficient C function to return maximum occurring character in the input string e.g., if input string is “test” then function should return ‘t’.… Read More »