This question already has an answer here:
- Garble that string! 9 answers
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.
Two strings, containing only lowercase, or only uppercase letters, your choice.
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
a is considered adjacent to
I really hope these are right. Mostly copied from the other challenge.
mayube, euabmy truthy aabcdeffghij, dbfhjfigaeca truthy abcde, badce falsey abcde, dbeca falsey aaa, aaa falsey stephen, nhseept falsey stephens, nhseespt truthy helowi, ioewlh falsey