Pergunta de entrevista da empresa Logics

How to distinguish a string is a substring of another