Close

## Character to be removed to become a palindrome

Given a string, We have to find out by removing which character, it becomes a palindrome.For example consider the string “racercar”, the character ‘r’ at index 4 should be removed to become a palindrome.The approach here is simple. Start from both ends of the string and compare both characters. If they are equal, we increment…

## Generating next bigger palindrome of a number

Given a number, how do we generate a smallest number which is greater than the given number and is a palindrome?Consider the following examplesInput    Output3         49         1113        22767       777594       595898       909999       1001Here is the solution approach. This problem has multiple cases to be considered.Case 1: If all the digits in the number are ‘9’, the output…

## Check if a number is the mirror image of itself

Given an arbitrarily large number, how to check if it is same as it’s mirror image. For example 101 is a mirror image of itself, where as 1811 is not a mirror image of itself. This problem is from Hacker earth (A website for competitive programming). If you want to solve this problem on your…

## Checking if any anagram of a given string is palindrome or not

Given a string, how do we check if any anagram of it can be a palindrome? For example let us consider the string “AAC”. An anagram of it is “ACA” which is a palindrome. We have to write a method which takes a string and outputs true if we can form a palindrome from any…