20 lines
303 B
Go
20 lines
303 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
counts := make(map[string]int)
|
|
input := bufio.NewScanner(os.Stdin)
|
|
for input.Scan() {
|
|
counts[input.Text()]++
|
|
}
|
|
|
|
// NOTE: ignoring potential errors from input.Err()
|
|
for line, n := range counts {
|
|
fmt.Printf("%d\t%s\n", n, line)
|
|
}
|
|
}
|