Inspired by Input ∩ Source Code.
Task
- 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 quine 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.
i=>([...i].sort().reduce((a,b)=>(a<<5)-a+b.charCodeAt(0),0)&4095)==2337
\$\endgroup\$