I'm playing on bedrock and I'm making a UHC map. I have a scoreboard set up where it lists everyone still alive, and once people die they get taken off the scoreboard. I want a command to test when only one person is left on the scoreboard. This last survivor would be the winner and I would like to have a title appear when they win.
For my UHC I have a repeating command block setting the players spawn point inside an enclosed bedrock box. When the player dies and spawns in this box, they land on a pressure plate resetting their score on the alive scoreboard, hence taking their name off the display. After their score is reset, the are teleported into a room where they have the option to spectate.