Pergunta de entrevista da empresa Amazon

I was asked was to implement an algorithm to find the longest substring without repeating characters.

Resposta da entrevista

Sigiloso

6 de set. de 2025

I explained my thought process step by step, starting with a brute force solution and then optimizing it using a sliding window with a hash set to track characters. This reduced the time complexity to O(n). I also walked through an example to make my approach clear.