# Is that string garbled? [duplicate]

Mayube recently posted Garble that string. However, humans aren't too good at checking whether a string is actually garbled or not. (Actually, that's an understatement, we are really bad at it.) So, let's save some time making test cases, and see if a string is actually garbled.

# Input

Two strings, containing only lowercase, or only uppercase letters, your choice.

# Output

Truthy/falsey based on if the second string is a garbled version of the first one (or vice-versa, I believe).

A string is garbled if (same as original challenge):

• No character is in it's original position
• No character is adjacent to a character that it was originally adjacent to

Note that duplicate characters keep rules from all other copies of them.

Adjacency also wraps from one end to the other, so for abcd, a is considered adjacent to d.

# Test Cases

I really hope these are right. Mostly copied from the other challenge.

mayube, euabmy truthy
aabcdeffghij, dbfhjfigaeca truthy
abcde, dbeca falsey
aaa, aaa falsey
stephen, nhseept falsey
stephens, nhseespt truthy
helowi, ioewlh falsey


## marked as duplicate by Rɪᴋᴇʀ, Sriotchilism O'Zaic, mbomb007, ovs, user62131 Jun 8 '17 at 20:45

• don't forget to mention that adjacency wraps, meaning the 2 ss in stephens are adjacent – Skidsdev Jun 8 '17 at 16:08