Liam vs. Noah: Chess Battle
Liam enjoys playing chess, and so does his friend Noah. One day, they played n games in a row. For each game, it is known who the winner was—Liam or Noah. None of the games ended in a tie.
Now Liam is curious to know who won more games - him or Noah. Can you help him find out?
Given a string s, consisting of uppercase English letters L and N — the outcome of each of the games. The i-th character of the string is equal to L if the Liam won the i-th game and N if Noah won the i-th game, return a string with Noah If Noah won more games than Liam and Liam in the opposite case. If Noah and Liam won the same number of games, return Friendship
Example 1
Input:
LNLLLL
Output:
Liam
Example 2
Input:
NLNLNL
Output:
Friendship
Example 3
Input:
NNLNLN
Output:
Noah
main.cpp
C++
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme