Pergunta de entrevista da empresa HubSpot

shortest substring in a string -- devise an algo in any language inside a web-based IDE to find the shortest substring. I used a window function.