Canadian Computing Competition: 2014 Stage 1, Junior #2
A vote is held after singer A and singer B compete in the final round of a singing competition. Your job is to count the votes and determine the outcome.
Input Specification
The input will be two lines. The first line will contain , the total number of votes. The second line of input will be a sequence of characters, each of which will be A
or B
, representing the votes for a particular singer.
Output Specification
The output will be one of three possibilities:
A
, if there are more A votes than B votes;B
, if there are more B votes than A votes;Tie
, if there are an equal number of A votes and B votes.
Sample Input 1
6
ABBABB
Output for Sample Input 1
B
Sample Input 2
6
ABBABA
Output for Sample Input 2
Tie
Comments
done in 8 mins w/ comments! lets go!!
im 8 and need help
hi 8 and need help I'm dad
lol... "Name error" kept existing and I spend HALF AN HOUR finding the problem till I realized instead of "print" I wrote a "pirnt"...
Can someone help me? even a small hint would be very helpful.
Your code is more complex than it needs to be. Try using only the count function, and no lists. Also, for help, please join the dmoj discord server instead of asking for help in the comments.
Then what's the point of the comments?
For comments
Comments about what?
Comments about using the discord server instead of asking for help in the comments.
Is the input used only for the iteration?
At first I thought it would be used to build the sequence of characters, but then in the end, I realized it wasn't.
Yes, it is there to tell you how many characters there will be, as stated by the problem.
For example, if you are to ignore it, you will need 2 for-loops to get the answer, instead of one
This comment is hidden due to too much negative feedback. Show it anyway.
But not everyone is as skilled as you
Thanks, no thanks :)
lol