Submit | All submissions | Best solutions | Back to list |
ANAGRAMS - Anagram (challenge) |
Wersja polska | English version | Deutsche Fassung |
In this problem, you are given two strings S1 and S2, your task is to determine whether one string is an anagram of the other.
Input
The first line would consist of the number of test cases t (t<100). This would be followed by t lines consisting of two space separated strings. Each string would consist of no more than 100 characters.
Output
You have to print YES if one string is an anagram of the other or NO otherwise.
Example
Input:
4
aaba aaab
abcd deba
tom_marvolo_riddle_ i_am_lord_voldemort
_gregory_House Huge_ego_sorry
Output:
YES
NO
YES
YES
Added by: | Piotr Kąkol |
Date: | 2010-04-27 |
Time limit: | 2.277s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: NODEJS OBJC SCM qobi VB.NET |
Resource: | Copy of Pratik's task ANAG with different scoring |
hide comments
2013-09-12 20:27:05 Piotr KÄ…kol
I've looked into it and only Contest Setters on their contests are able to do it. |
|
2013-09-12 17:51:53 Jander
Odd - I tried HTML earlier and it didn't work - it displayed it as-is. I wanted to link to Mitch's details. |
|
2013-09-12 15:58:44 challenger
@Jander - Good job. :-) Only Problem Setters can do it. As you're one of them just use HTML, as you can read at the bottom of the page. // I've updated language rankings and will do it manually from time to time. |
|
2013-09-12 14:38:52 Jander
Oooh, you ratbag Challenger ! 42 in sed indeed. [Edit] "info sed" told me a bit more than "man sed" did :-) Blame Mitch for getting me in to sed! On a side note, how does one put links in to a comment? Last edit: 2013-09-12 15:01:29 |
|
2012-03-10 21:08:39 Piotr KÄ…kol
There was a rejudge thanks to Jander who showed that there's an incorrect program which gets AC. Sorry for any inconvenience. Last edit: 2012-03-10 21:08:56 |
|
2012-02-26 02:28:52 Hallvard Norheim Bø
Piotr: of course...it just didn't occur to me. Guess that kills my algorithm :( |
|
2012-02-25 20:17:31 Piotr KÄ…kol
[A-Za-Z0-9_!] What if S1.size()!=S2.size()? |
|
2012-02-25 13:36:09 Hallvard Norheim Bø
What characters are allowed in the input strings? Only [A-Za-z_] like in the examples? Could you please give a testcase where my submission #6561574 fails? Last edit: 2012-02-25 13:36:40 |
|
2010-04-27 20:42:42 :(){ :|: & };:
This is precisely the same problems with *different input restriction* :) Last edit: 2010-04-28 07:03:11 |