#C6574. Balanced String Checker
Balanced String Checker
Balanced String Checker
Given a string s
containing only the characters 'a' and 'b', determine if the string is balanced. A string is considered balanced if the number of occurrences of 'a' is equal to the number of occurrences of 'b'. In mathematical notation, a string is balanced if $$\#(a) = \#(b)$$.
Your task is to implement a program that reads the string from standard input and prints True
if the string is balanced, otherwise prints False
.
Note: The input string may be empty. An empty string is considered balanced.
inputFormat
The input consists of a single line containing a string composed only of characters 'a' and 'b'. The string may be empty.
outputFormat
Output True
if the string is balanced; otherwise, output False
.## sample
ab
True