|
|
|
@ -46,6 +46,24 @@ func ParseIntArray(s string, sep string) []int {
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func ParseInt64Array(s string, sep string) []int64 {
|
|
|
|
|
|
|
|
result := []int64{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var vals []string
|
|
|
|
|
|
|
|
if sep == " " {
|
|
|
|
|
|
|
|
vals = strings.Fields(strings.TrimSpace(s))
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
vals = strings.Split(strings.TrimSpace(s), sep)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for _, val := range vals {
|
|
|
|
|
|
|
|
n, _ := strconv.ParseInt(val, 10, 64)
|
|
|
|
|
|
|
|
result = append(result, n)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func IntPow(x int, y int) int {
|
|
|
|
func IntPow(x int, y int) int {
|
|
|
|
result := 1
|
|
|
|
result := 1
|
|
|
|
|
|
|
|
|
|
|
|
|