Units and zeros

Report a typo

The current program gets a sequence of zeros and ones as input. First, you need to count how many times each digit repeats within the sequence. Then, compare these numbers and print one of the answers:

  • The count of zeros is bigger

  • The count of units is bigger

  • Counts are equal

Sample Input 1:

10101010010101011

Sample Output 1:

The count of units is bigger
Write a program in Go
package main

import (
"fmt"
"strings"
)

func main() {
var source string

fmt.Scan(&source)

// Your code here
}
___

Create a free account to access the full topic