Valve

1 DSA problems asked in Valve coding interviews

0 Easy
1 Medium
0 Hard
​

1 problem

Greedy
1
Dota2 Senate
Medium

The senate of the Dota2 world has senators from two parties, Radiant (`R`) and Dire (`D`). Voting runs in rounds, in seat order. On their turn, a senator who still has rights may either ban one other senator, who then loses every right in this and all later rounds, or announce victory if every senator still holding rights belongs to their own party. Every senator plays the best strategy for their party. Given the string `senate`, return `"Radiant"` or `"Dire"`, the party that announces victory.