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.
27 lines
433 B
27 lines
433 B
8 months ago
|
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()
|
||
|
}
|