시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 275 | 229 | 212 | 86.531% |
The historical battle between numbers and strings has taken a new twist: numbers are bragging on their categorization of being “even” or “odd” and strings lacking such feature. But don’t count strings out yet!
A string is considered “even” if every letter in the string appears an even number of times; the string is “odd” if every letter in the string appears an odd number of times.
Given a string, determine whether the string is even, odd, or neither.
The input consists of a single line, starting in column 1, not exceeding column 70, and containing only the lowercase letters (at least one letter).
The output consists of a single integer: print 0 (zero) if the string is even, 1 (one) if the string is odd, or 2 if the string is not even and is not odd (i.e., it is neither).
coachessoaehwwwwww
0
coachesarefun
2
coachesc
1