keywords Computer Science Computer Science, Theory & Methods Science & Technology Technology WORD d-step approach distinct squares primitively rooted distinct squares string