Is your feature making a change to an existing problem/algorithm
yes
If you are making changes, please describe the type of change in brief else NA
Given a string s, find the length of the longest substring without repeating characters. This problem will be added in java language.
Describe in brief about what new problem/algorithm addition
the idea is, keep a hashmap that stores the characters in a string as keys and their positions as values, and keep two pointers that define the max substring. move the right pointer to scan through the string, and meanwhile update the hashmap. If the character is already in the hashmap, then move the left pointer to the right of the same character last found. Note that the two pointers can only move forward.
Is your feature making a change to an existing problem/algorithm yes
If you are making changes, please describe the type of change in brief else NA Given a string s, find the length of the longest substring without repeating characters. This problem will be added in java language.
Describe in brief about what new problem/algorithm addition the idea is, keep a hashmap that stores the characters in a string as keys and their positions as values, and keep two pointers that define the max substring. move the right pointer to scan through the string, and meanwhile update the hashmap. If the character is already in the hashmap, then move the left pointer to the right of the same character last found. Note that the two pointers can only move forward.