func MergeSortedStrings(n ...[]string) []string {
	var result []string
	if len(n) == 0 {
		return nil
	} else if len(n) == 1 {
		return MergeSortedStrings(n[0], nil)
	}
	var maxSize int
	for _, a := range n {
		if len(a) > maxSize {
			maxSize = len(a)
		}
	}
	result = make([]string, 0, maxSize)  
	idxs := make([]int, len(n))  
	var j int                    
	for {
		j = -1
		for i := 0; i < len(n); i++ {
			if idxs[i] >= len(n[i]) {
				continue  
			} else if j == -1 {
				j = i
				continue
			}
			if n[i][idxs[i]] < n[j][idxs[j]] {
				j = i
			} else if n[i][idxs[i]] == n[j][idxs[j]] {
				idxs[i]++
			}
		}
		if j == -1 {
			break
		}
		if len(result) == 0 {
			result = append(result, n[j][idxs[j]])
			idxs[j]++
			continue
		}
		if result[len(result)-1] < n[j][idxs[j]] {
			result = append(result, n[j][idxs[j]])
		} else if result[len(result)-1] == n[j][idxs[j]] {
		} else {
			panic("value being merged out of order.")
		}
		idxs[j]++
	}
	return result
}
Merge uses a k-way merge to merge n collections of sorted byte slices.

The resulting slice is returned in ascending order, with any duplicate values
removed.
package slices
import "bytes"
func MergeSortedFloats(n ...[]float64) []float64 {
	var result []float64
	if len(n) == 0 {
		return nil
	} else if len(n) == 1 {
		return MergeSortedFloats(n[0], nil)
	}
	var maxSize int
	for _, a := range n {
		if len(a) > maxSize {
			maxSize = len(a)
		}
	}
	result = make([]float64, 0, maxSize)  
	idxs := make([]int, len(n))  
	var j int                    
	for {
		j = -1
		for i := 0; i < len(n); i++ {
			if idxs[i] >= len(n[i]) {
				continue  
			} else if j == -1 {
				j = i
				continue
			}
			if n[i][idxs[i]] < n[j][idxs[j]] {
				j = i
			} else if n[i][idxs[i]] == n[j][idxs[j]] {
				idxs[i]++
			}
		}
		if j == -1 {
			break
		}
		if len(result) == 0 {
			result = append(result, n[j][idxs[j]])
			idxs[j]++
			continue
		}
		if result[len(result)-1] < n[j][idxs[j]] {
			result = append(result, n[j][idxs[j]])
		} else if result[len(result)-1] == n[j][idxs[j]] {
		} else {
			panic("value being merged out of order.")
		}
		idxs[j]++
	}
	return result
}
func MergeSortedInts(n ...[]int64) []int64 {
	var result []int64
	if len(n) == 0 {
		return nil
	} else if len(n) == 1 {
		return MergeSortedInts(n[0], nil)
	}
	var maxSize int
	for _, a := range n {
		if len(a) > maxSize {
			maxSize = len(a)
		}
	}
	result = make([]int64, 0, maxSize)  
	idxs := make([]int, len(n))  
	var j int                    
	for {
		j = -1
		for i := 0; i < len(n); i++ {
			if idxs[i] >= len(n[i]) {
				continue  
			} else if j == -1 {
				j = i
				continue
			}
			if n[i][idxs[i]] < n[j][idxs[j]] {
				j = i
			} else if n[i][idxs[i]] == n[j][idxs[j]] {
				idxs[i]++
			}
		}
		if j == -1 {
			break
		}
		if len(result) == 0 {
			result = append(result, n[j][idxs[j]])
			idxs[j]++
			continue
		}
		if result[len(result)-1] < n[j][idxs[j]] {
			result = append(result, n[j][idxs[j]])
		} else if result[len(result)-1] == n[j][idxs[j]] {
		} else {
			panic("value being merged out of order.")
		}
		idxs[j]++
	}
	return result
}
func MergeSortedUInts(n ...[]uint64) []uint64 {
	var result []uint64
	if len(n) == 0 {
		return nil
	} else if len(n) == 1 {
		return MergeSortedUInts(n[0], nil)
	}
	var maxSize int
	for _, a := range n {
		if len(a) > maxSize {
			maxSize = len(a)
		}
	}
	result = make([]uint64, 0, maxSize)  
	idxs := make([]int, len(n))  
	var j int                    
	for {
		j = -1
		for i := 0; i < len(n); i++ {
			if idxs[i] >= len(n[i]) {
				continue  
			} else if j == -1 {
				j = i
				continue
			}
			if n[i][idxs[i]] < n[j][idxs[j]] {
				j = i
			} else if n[i][idxs[i]] == n[j][idxs[j]] {
				idxs[i]++
			}
		}
		if j == -1 {
			break
		}
		if len(result) == 0 {
			result = append(result, n[j][idxs[j]])
			idxs[j]++
			continue
		}
		if result[len(result)-1] < n[j][idxs[j]] {
			result = append(result, n[j][idxs[j]])
		} else if result[len(result)-1] == n[j][idxs[j]] {
		} else {
			panic("value being merged out of order.")
		}
		idxs[j]++
	}
	return result
}