Couldn’t you more easily determine adjacency of two words via a single for loop, checking to determine if the difference between the two strings is at most 1 character? All the string manipulation seems inefficient.
Couldn’t you more easily determine adjacency of two words via a single for loop, checking to determine if the difference between the two strings is at most 1 character? All the string manipulation seems inefficient.