If elements are added to an array (or set, dictionary), how can it result in unique elements (which set does case-sensitively) but prefer capitalized words instead of their lower-case alternatives (e.g. Apple instead of apple).
Example:
items = []
items.append('apple')
items.append('orange')
items.append('Apple')
items.append('grapes')
items.append('Orange')
Expected result:
[ 'Apple', 'Orange', 'grapes' ]
It'll be good to keep the original order by first occurrence (as in the result above).
I don't want to use any 3rd-party packages for this.