Your question is Longest Unique Messenger Substring. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
In Meta Messenger, you are given a message string s. Return the length of the longest contiguous substring that contains no repeated characters.
This is a standard string and sliding-window problem: scan the string once and maintain the largest valid window with all unique characters.
ss with all distinct charactersdef length_of_longest_substring(s):