Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.

book
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

main.cpp

C++

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt