All challenges
mediumstrings 10 XP per passing test

Anagram Check

Problem

Given two strings, write a program to check if they are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. For example, 'listen' and 'silent' are anagrams of each other. The input strings will be in lowercase and contain only letters. The input will be in the following format: line 1 = string 1, line 2 = string 2. The program should print 'true' if the strings are anagrams and 'false' otherwise.
(run your code to see output)
Advertisement
Sponsored