In the world of Dota
The senate consists of senators from both parties. Each senator belongs to one of the two parties and participates in a round based voting process to determine the outcome.
In each round, senators act in the order they appear from left to right. Each active senator can exercise one of the following two rights:
Ban a Senator’s Voting Right: An active senator can ban one senator from the opposing party, causing them to lose all rights to vote in this round and all subsequent rounds.
Announce Victory: If an active senator finds that all remaining active senators belong to their own party, they can announce victory for their party and conclude the voting process.
Suppose every senator plays greedily and adopts the best strategy to secure victory for their party. Given a string senate representing each senator’s party affiliation where 'R' represents Radiant and 'D' represents Dire, determine which party will win.
Return "Radiant" if the Radiant party wins, or "Dire" if the Dire party wins.
Constraints:
senate.length
senate[i] is either 'R' or 'D'
In the world of Dota
The senate consists of senators from both parties. Each senator belongs to one of the two parties and participates in a round based voting process to determine the outcome.
In each round, senators act in the order they appear from left to right. Each active senator can exercise one of the following two rights:
Ban a Senator’s Voting Right: An active senator can ban one senator from the opposing party, causing them to lose all rights to vote in this round and all subsequent rounds.
Announce Victory: If an active senator finds that all remaining active senators belong to their own party, they can announce victory for their party and conclude the voting process.
Suppose every senator plays greedily and adopts the best strategy to secure victory for their party. Given a string senate representing each senator’s party affiliation where 'R' represents Radiant and 'D' represents Dire, determine which party will win.
Return "Radiant" if the Radiant party wins, or "Dire" if the Dire party wins.
Constraints:
senate.length
senate[i] is either 'R' or 'D'