A string barcoding problem is defined as to find a minimum set of substrings that distinguish between all strings in a given set of strings . In a biological sense the given strings represent a set of genomic sequences and the substrings serve as probes in a hybridisation experiment. In this paper, we study a variant of the string barcoding problem in which the substrings have to be chosen from a particular set of substrings of cardinality n. This variant can be also obtained from more general test set problem, see, e.g.,  by fixing appropriate parameters. We present almost optimal -time approximation algorithm for the considered problem. Our approximation procedure is a modification of the algorithm due to Berman et al.  which obtains the best possible approximation ratio (1∈+∈ln n), providing . The improved time complexity is a direct consequence of more careful management of processed sets, use of several specialised graph and string data structures as well as tighter time complexity analysis based on an amortised argument.