That’s a good idea!
Note that you don’t actually need to store the enemies in an array. Updating some kind of global int value to keep track of their number would be enough.
As for the formula, you could use something like: chance = 1 / numberOfRemainingEnemies if you want a flat chance for each killed enemy, or you could combine that with a check comparing the number of remaining enemies is smaller than a certain cutoff.