You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lavos/cap3/example.go

27 lines
433 B

package cap3
import "strings"
type AlgoType int
const (
AlgoTypeRecursion AlgoType = iota
AlgoTypeNoneRecursion
)
func DigitSlice2String(nums []uint8) string {
zeroPrefix := true
sb := strings.Builder{}
for _, num := range nums {
if zeroPrefix && num == 0 {
continue
} else {
zeroPrefix = false
}
sb.WriteByte(num + 48)
}
return sb.String()
}