Check Anagram
A word-game app has a round where a player is shown a word and has to type a second word built from exactly the same letters — every letter of one pairs off with a letter of the other, with none spare on either side. Upper and lower case count as the same letter. The app has to accept or reject the player's word instantly.
Task: Read the two words and report whether the second uses exactly the same letters as the first.
Input
Two lines. Line 1 holds the first word, line 2 holds the second. Each is 1 to 100 letters with no spaces. The two words may be different lengths.
Output
One line holding exactly Yes if the two words use the same letters the same number of times, or exactly No if they do not. Capital first letter, no quotes.
Example:
Input:
listen
silent
Output:
Yes
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in