Pregunta de entrevista de AccelByte

Explain the algorithm to check if string match in specific conditions!