# Inspired by Input ∩ Source Code.

• Your task is to determine whether the input is a permutation of the source code.

# Input

• A string. Input is flexible; it should be able to handle the character encoding used for the source code.

# Output

• You may only have two possible outputs, one when the input is a permutation of the source code, and one when it is not. Those outputs maybe be of any length (including 0) but must be distinct, consistent, and deterministic.

# Specs

• Similar to challenges, the program/function may not read its own source code and 0-byte solutions are not allowed.

# Example

If your source code is ppcg, then an input of cpgp or ppcg would be a permutation of the source code while cpg or cggp or caqp or cpaqr would not be.

## marked as duplicate by AdmBorkBork, NoOneIsHere, Community♦Aug 17 '16 at 16:01

• Do I need to consider new lines too? – Rod Aug 17 '16 at 14:54
• This is a generalised quine of this question. IMO that makes it borderline dupe. – Peter Taylor Aug 17 '16 at 15:06
• Closed a few seconds before I hit the 'post' button. Ah well, here it is anyway. Javascript, 71 bytes: i=>([...i].sort().reduce((a,b)=>(a<<5)-a+b.charCodeAt(0),0)&4095)==2337 – Arnauld Aug 17 '16 at 16:08
• The "duplicate" asks to check if two strings are equal up to permutation. In this challenge one of those strings is the source code of the program you are using for the task. How can it be a duplicate? Does any of those answers work here, even with some modifications? – Luis Mendo Aug 17 '16 at 16:35
• @LuisMendo because there are no viable solutions to this challenge except combining the language's standard generalised quine with the shortest solution from the other challenge. There's no good way to solve this except by tacking the string processing problem onto a normal quine, so this challenge doesn't add anything new. – Martin Ender Aug 17 '16 at 20:26

print sorted(list(input()))==sorted(list('\''*7+'\\'*3+'print sorted(list(input()))==sorted(list(*7+*3+*2))'*2))

• In the meantime can you use ; to eradicate newlines? We're discussing about newlines – Leaky Nun Aug 17 '16 at 15:12