Compute longest distinct substring, case-insensitive
UiPathSoftware Engineer · Technical ScreenLast updated
This question evaluates competency in string processing, character normalization for case-insensitivity, algorithmic complexity analysis, and handling large-scale or streaming inputs.
Given a string s, return the length of the longest contiguous substring that contains no repeated characters, treating letters case-insensitively (e.g., 'A' and 'a' are the same). All ASCII symbols and whitespace should be considered valid characters. Provide an algorithm with optimal time complexity, justify its time and space bounds, and discuss edge cases (empty string, all duplicates, Unicode input). For extremely large inputs that cannot fully fit in memory, outline how you would process the stream to compute the answer and the trade-offs involved.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.