Given a list of strings such as: apple01, apple02, and apple04, banana02, cherry01, how would you come up with t
The naive and straight-forward solution would be based on pre-generating a list of syntax valid names.
Query names that are already in use and store the results into a collection.
Iterate the used names collection and remove those from the pre-generated collection.
Sort the pre-generated collection.
Now you got a collection that contains unused names in sorted order. Pick any number of desired names for further usage.