Pyth, 23 bytes
Ju+G*]GHQYjbmj\ msqdkJJ
Input is a list of integers, like [3, 2, 1]
. Try it online: Pyth Compiler/Executor
Uses a quite similar idea as randomra's J code.
Ju+G*]GHQYjbmj\ msqdkJJ
Input is a list of integers, like [3, 2, 1]
. Try it online: Pyth Compiler/Executor
Uses a quite similar idea as randomra's J code.