85
11
Challenge
Given two strings, work out if they both have exactly the same characters in them.
Example
Input
word, wrdo
This returns true
because they are the same but just scrambled.
Input
word, wwro
This returns false
.
Input
boat, toba
This returns true
Rules
Here are the rules!
- Assume input will be at least 1 char long, and no longer than 8 chars.
- No special characters, only
a
–z
- All inputs can be assumed to be lowercase
Test Cases
boat, boat = true
toab, boat = true
oabt, toab = true
a, aa = false
zzz, zzzzzzzz = false
zyyyzzzz, yyzzzzzy = true
sleepy, pyels = false
p,p = true
5Title request: Cod Elf, Go! – None – 2016-07-09T12:48:45.677
109 answers in 13 views... wow! – Tom Gullen – 2011-03-08T16:44:10.537
@Tom, because everyone wanted to prove that your comment about using a 64-bit integer was pointing in the wrong direction :P – Peter Taylor – 2011-03-08T18:15:29.563
@user54200 Nah... it should be "Nag a ram Cod Elf, Go!"
– Erik the Outgolfer – 2016-10-05T14:31:47.1375"Falcon Rage, go mad!" – Geobits – 2016-10-06T17:25:24.543
8My name suggestion: "are they anagrams" → "manage the arrays" – Esolanging Fruit – 2017-10-31T04:32:23.430