NVIDIA interview question

Sequence detector.