package main
import (
"fmt"
"unicode"
)
func moveDigitsToFront(input string) string {
var digits, others []rune
for _, char := range input {
if unicode.IsDigit(char) {
digits = append(digits, char)
} else {
others = append(others, char)
}
}
return string(digits) + string(others)
}
func main() {
input := "d2c54be3a1"
result := moveDigitsToFront(input)
fmt.Println(result)
}
/*
run:
25431dcbea
*/