I'm working on making a shopping web site which created a unique discount code for each person.
I want to generate a one percent discount for this code, for example:
x3M2qE => 10%
gh2WW4 => 20%
...
These codes should be created in such a way that The probability of generating 90% is much less than the generation of 10%.
Identify the best and most optimal algorithm and help me to do it properly,
thanks.