Design ideas:
Each time you remove two different IDs from the ID list, it does not affect the fact that the water King's ID is still more than half the remaining ID, so every time you delete two different IDs until all the remaining IDs are the same, then the ID of the water king remains.
Specific implementation:
For specific programming, use a candidate to record the current guessed water King ID, a count to record its cumulative number, and then traverse the entire ID list, for the currently examined ID, if and candidate the same, then count++, if different, then count--, This "count--;" The action is "delete two different IDs" in the embodiment of the program, when Count==0, then update candidate. So, each time count--is equivalent to delete two different IDs (may contain water king, may not contain), and each visit an ID, either will do count--action, or will do count++ action, both will be one, and because "water King ID more than half" the fact that So the number of count--must be less than count++, so the last count must be a positive integer, and at this time the candidate must record the water King's ID.
Find a post water King 01