solution for striped words problem