Sha256: 0c179b70d014d6557ce54757d1997328997c476bfcfac838cb80ed66a0533d38
Contents?: true
Size: 398 Bytes
Versions: 173
Compression:
Stored size: 398 Bytes
Contents
package transpose func Transpose(m []string) []string { max := maxLen(m) t := make([]string, max) for i, row := range m { for j, c := range row { t[j] += string(c) } remMax := maxLen(m[i:]) for j := len(row); j < remMax; j++ { t[j] += " " } } return t } func maxLen(m []string) (length int) { for _, l := range m { if len(l) > length { length = len(l) } } return }
Version data entries
173 entries across 173 versions & 1 rubygems