I couldn't solve it by my algorithm which was calculating the number of possible ways for each player. But it needed calculation for each player which would have made it exceed TL.
In short, how would you explain your solution? I just need a few hints if possible :)