codeintuition-logo

Understanding the pattern generation pattern


Every sequence of items follows an inherent pattern that can be described by the relative position of its items with each other. Consider the two strings given below; it is easy to see that though the strings are completely different, they follow the same pattern.

Loading Image

Two completely different strings that follow the same pattern.

While the human mind can easily recognize such patterns in sequences based on the relative positioning of items in each sequence, it is impossible for a machine to do it. The pattern generation technique is a powerful technique that uses a hash table to assign a unique pattern string to all sequences that follow the same pattern.

Liking the course? Check our discounted plans to continue learning.