[Wolfram Mathematica][1], 34 bytes = Tr[1^z]∣Tr[z=ToCharacterCode@#]& Takes input as string, e.g.: Tr[1^z]∣Tr[z=ToCharacterCode@#]&@"abcb" >True [1]: https://www.wolfram.com/mathematica/