solution for strings