packagelexicalimport"sort"// Sort takes a string as input and returns the lexical order.funcSort(wordstring)(sortedstring){// Convert the string to []rune.varr[]runefor_,char:=rangeword{r=append(r,char)}sort.Slice(r,func(i,jint)bool{returnr[i]<r[j]})sorted=string(r)return}