Update unique_strings.c

Optimization added for the for loop