Anton and Danik
Practice this coding question on Coding Gurukul.
Problem statement
A match log records A when Anton wins and D when Danik wins. Compare their total wins after all games. Output the name of the player with more wins, or Friendship when their totals are equal.
Input format
First line: n. Second line: a string of n characters A or D.
Output format
Print Anton, Danik, or Friendship with exactly this capitalization.
Constraints
1 <= n <= 100000.
Sample input
6 AADADD
Sample output
Friendship
Sign in to run or submit a solution in C++, Java or Python.