codeintuition-logo

Identify the sequence validation pattern


The sequence validation technique we learned earlier can only solve some specific types of problems. These are generally easy or medium problems where we are given a sequence of start and end events and certain rules governing what constitutes a valid sequence. It is very difficult to solve such problems without using the sequence validation technique, as we need to keep multiple events in the most to least recent order.

If the problem statement or its solution follows the generic template below, it can be solved by applying the sequence validation technique.

Template:

Given a sequence of start and end events and a set of rules defining validity, determine if the sequence is valid or not.

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