oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

anagramword Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

anagramword.html

Anagram: The transposition of letters from a word or phrase to form a new word or phrase.

In other words, an anagram is a rearrangement of the letters of a word/sentence to form another.

Examples include:
Mother-in-law --> Woman Hitler
The Morse code --> Here come dots
etc...

Task

Write a program which will compare two sentences and see if they are anagrams of each other (ignore spaces and punctuation). Your progam is to output "YES" if they are anagrams of each other and "NO" if they are not.

Constraints

2 strings of any length

Input

Your program should read from standard input the following data: The first line contain string 1. The second line contains string 2.

Output

Your program should output to standard output "YES" or "NO".

Sample Input 1

Election results.
Lies? let's recount

Sample Output 1

YES

Sample Input 2

Astronomer
Star starer

Sample Output 2

NO

Tags

String Processing

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s32MBAverage
2001s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o anagramword -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.