Random Country Generator with Population Bias

Problem: Random Country Generator with Population Bias

Given n countries and their population weights weight[i], implement a weighted random country generator so that each country is returned ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: