Added a duplicated string algorithm