|
|
|
|
|
by DougBTX
2622 days ago
|
|
The output form this is a little different form the article, as it additionally requires: * that the uniqueness check is done case-insensitively, * that the casing from the first instance of the string in the input array should be used in the output, and * that the output should be ordered based on the order of the first instance of the string in the input array Possibly an unusual set of requirements (I'd generally expect that if removing duplicates from a list, that the output order wouldn't matter) but hey, different problems have different requirements. The desired output is: apple
cAt
Dog
banana
while that code snippet produces: apple
cAt
cat
Dog
dog
Cat
Apple
dOg
banana
|
|