Leetcode: Longest substring without repeating characters.

preview_player
Показать описание
Leetcode's problem number 3 solution in Java. The objective is to find the longest substring within a given string, without any characters repeating.

I do this by keeping a map of characters along with their index and then loop through the characters in the string and refer back to the map to see if we've seen that character before.
Рекомендации по теме
visit shbcf.ru