Knuth's algorithm S: Difference between revisions

No edit summary
Line 115:
 
func sOfNCreator(n int) func(byte) []byte {
s := make([]byte, 0, 3n)
m := n
return func(item byte) []byte {
if len(s) < 3n {
s = append(s, item)
} else {
Anonymous user