Problem
In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 senate consists of senators from both parties. Voting is a round-based procedure. In each round, each senator (in order) can exercise one right:- Ban one senator’s right: make another senator lose all rights in this and all following rounds.
- Announce the victory: if all senators who still have rights are from the same party, announce victory.
senate where 'R' is Radiant and 'D' is Dire, predict which party announces victory. Output "Radiant" or "Dire". Every senator plays optimally for their own party.
Examples
Constraints
- n == senate.length
- 1 <= n <= 10^4
- senate[i] is either ‘R’ or ‘D’.