# [Jelly], 4 bytes Ṣm0w [Try it online!] Returns the index (1-based) of the first match in the concatenation of the sorted and reverse sorted, otherwise returns 0. In Jelly, zero is considered falsey and non-zero is truthy. ## Explanation Ṣm0w Input: string S Ṣ Sort S m0 Concatenate sort(S) with reverse(sort(S)) w Find the first index that contains S, else 0 [Jelly]: https://github.com/DennisMitchell/jelly [Try it online!]: https://tio.run/nexus/jelly#@/9w56Jcg/L/R/ccbn/UtMYbiCP//1d3dHJ2cXVT11FQj4qMAFF5@SCypCg1FUQXggiQGmcQozK1GES5uLq6qAMA "Jelly – TIO Nexus"