// should not trigger likely_n_squared_allocation because loop work reuses outer allocation and avoids make/new inside the nested loop.
package sample

func Flatten(rows [][]string) [][]byte {
	total := 0
	for _, row := range rows {
		total += len(row)
	}

	out := make([][]byte, 0, total)
	for _, row := range rows {
		for _, cell := range row {
			out = append(out, []byte(cell))
		}
	}
	return out
}