Post History
Python 3, 43 bytes lambda x:sorted(x,key='tibdfghklpqyj'.find) Try it online! Sorts based on index in a sorted string. Inputs as a string and outputs as a list. -14 bytes by replacing .inde...
Answer
#2: Post edited
# [Python 3], 57 bytes- <!-- language-all: lang-python -->
lambda x:sorted(x,key='acemnorsuvwxztibdfghklpqyj'.index)[Try it online!][TIO-la1j9g00]- Sorts based on index in a sorted string. Inputs as a string and outputs as a list.
[Python 3]: https://docs.python.org/3/[TIO-la1j9g00]: https://tio.run/##VVBBboMwELznFVYugIRy6Q0pL2mryAHTrAm2y66DTdW3U9sQtz3t7Mx4Z73G002rl7VnZ/a23vl47ThzDeqJRFe6ehD@XPBWjEpPaB@zWwiuXf9xG@7m08viBKoTrlpJIF1ajgLDoK8DY0d@ZA17DeW9Tu2zz0QYJHcuwZod5RXoqRO0wya3BENUB6B2F5WeNy2CIKlZx6JV6vSsYplVImet9lfSIm3PJFlMgYQ2VrSUFggGuZuNXMiD2/zx28Yny@IyjKw3md2h9AZocRm6JUHjMxthYEPO9@HQ64nl69Xswe/QXbSlVo/hmKB@RTwBiRHLqgn7BYexFI7dl9lQBd5MoKj8M3AzRokjiolYUZykBlXuQoz4H7r@AA "Python 3 – Try It Online"
- # [Python 3], 43 bytes
- <!-- language-all: lang-python -->
- lambda x:sorted(x,key='tibdfghklpqyj'.find)
- [Try it online!][TIO-la75vn9b]
- [Python 3]: https://docs.python.org/3/
- [TIO-la75vn9b]: https://tio.run/##VZDBboQgEIbvPgXZi5oYL72Z7JO0zQYVu4MKrIwVbPrsFpCl7Wn@@b9/GDLK4l2Kl2MgV/J2THRue0pMo@WCrC9MNTJ7zRHafvi4j5N6WJ7XA4i@PJBpvHVUM@1GvzJCLvRCGvLqynsV2mefDPcOj16QFbnwFvDJEbrxxB3C6OkI2EUo5HYyLxwSm/RFitDJTfiyiWBuUsQpvmo8xziuOixEvfqqVwwfcAEew4rvaMGcebMjKBsiu0nSu1YlN0puFeBukjR7kMom10vnuj3fWTbIhaTrVeSTTtDf5IqdnN0xQfxCXQOyWRdl4/7nEmpFd@yhSIHS@WoBgcWfB8@gR1RrtiDJ85pLEEUEfsX/pccP "Python 3 – Try It Online"
- Sorts based on index in a sorted string. Inputs as a string and outputs as a list.
- -14 bytes by replacing `.index()` with `.find()`
#1: Initial revision
# [Python 3], 57 bytes <!-- language-all: lang-python --> lambda x:sorted(x,key='acemnorsuvwxztibdfghklpqyj'.index) [Try it online!][TIO-la1j9g00] Sorts based on index in a sorted string. Inputs as a string and outputs as a list. [Python 3]: https://docs.python.org/3/ [TIO-la1j9g00]: https://tio.run/##VVBBboMwELznFVYugIRy6Q0pL2mryAHTrAm2y66DTdW3U9sQtz3t7Mx4Z73G002rl7VnZ/a23vl47ThzDeqJRFe6ehD@XPBWjEpPaB@zWwiuXf9xG@7m08viBKoTrlpJIF1ajgLDoK8DY0d@ZA17DeW9Tu2zz0QYJHcuwZod5RXoqRO0wya3BENUB6B2F5WeNy2CIKlZx6JV6vSsYplVImet9lfSIm3PJFlMgYQ2VrSUFggGuZuNXMiD2/zx28Yny@IyjKw3md2h9AZocRm6JUHjMxthYEPO9@HQ64nl69Xswe/QXbSlVo/hmKB@RTwBiRHLqgn7BYexFI7dl9lQBd5MoKj8M3AzRokjiolYUZykBlXuQoz4H7r@AA "Python 3 – Try It Online"