Add additional solution for string duplication checking

This just adds an additional solution for this question and fixes an
off-by-one error in the existing solution.  Both are valid and have
benefits, which are explained in the comments.

Signed-off-by: Charlie Mooney <cmooney3@gmail.com>