Since it was a reverse engineering challenge, I opened the elf file in Ghidra. This code computes if the input string length is 18 characters long and if it is will call myfunc(local_38) else, it outputs :P.
In this function, it compares character by character, if every character is correct, it outputs the flag. This indicated to me that inputting the same string will result in the flag by rearranging it.