Given a string, find its rank among all its permutations sorted lexicographically. For example, rank of “abc” is 1, rank of “acb” is 2, and… Read More »
Write a function to check whether two given strings are anagram of each other or not.
Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B.
Given two strings str1 and str2, write a function that prints all interleavings of the given two strings. You may assume that all characters in… Read More »
Given a string of length n, print all permutation of the given string. Repetition of characters is allowed. Print these permutations in lexicographically sorted order
We have discussed Overlapping Subproblems and Optimal Substructure properties in Set 1 and Set 2 respectively.
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 »