OPTIML Interview Question

Coding challenge: substring search and complexity