Print all repeating characters in a string

We have already seen the problem to print first repeating character in a string. In this post we will be looking at printing all the […]

Print the first repeating character in String

Give a string in which characters may be repeating. Print the first character (from the start) which is repeating in the string. For example: String: […]

Recursive function to reverse a String

We have already seen the problem to reverse the words in a string, in the solution to that problem we have also written function to reverse […]

Check if one string is rotation of another

Given two strings, write code to check if one string is rotation of another. For example: str2 below is a rotation of str1. str1 = […]

Check if two strings are anagrams

An anagram is a word play. If letters of a word can be arranged to form another word, the two words are called anagrams. e.g […]

Remove duplicates from a string

Given a string of characters. Write code which will remove duplicate characters from the string: Input: "social.ritambhara.in" Output: "social.rtmbhn"

Reversing words in a String

Given a String, reverse the string but do not reverse the words. For example, if Input : "MCN Professionals is now Ritambhara" Output: "Ritambhara now […]

Permutations of a String or Array

Print all possible permutations of an Array or a String. For Example: If the array is arr={1, 2, 3}. Then the possible permutations are: 1 […]

Print all interleavings of two strings

Given two strings, write code to print all inter-leavings of these strings.  For example: if the two strings are  “AB” and “12”, then the output […]