Interview Solution

The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability. Randall E. Stross

String Anagram

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm

Comments


Interview Problem

Check whether two given strings are an anagram of each other or not.
Write a program to check anagram for given two strings. An anagram of a string is another string that contains same characters, only the order of characters can be different
Example:-
"silent" which can be rearranged to "listen". The two can be used in the phrase, "Think about it, SILENT and LISTEN are spelled with the same letters"


Output

   					 
Check anagram for 'silent' and 'listen' :true
Check anagram for 'test1' and 'test2' :false

				    

Comments



Please login to add comments.