by@hakatashi
WA
a=() while read -n 1 c; do a+=($c) done q(){ local k i s=() l=() p=() (($#==0)) && return 0 k=$1 shift for i; do if [[ $i < $k ]]; then s+=( "$i" ) else l+=( "$i" ) fi done q "${s[@]}" s=( "${p[@]}" ) q "${l[@]}" l=( "${p[@]}" ) p=( "${s[@]}" "$k" "${l[@]}" ) } q "${a[@]}" b=$(IFS=;echo "${p[*]}") echo $b
2841126753771174542746006382082045193527973164408530206341134265811968366956100301791251623107196913
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) /code.bash: line 5: syntax error near unexpected token `$'{\r'' /code.bash: line 5: `q(){ '