As reported: Walmart Senior Software Engineer hiring drive, round 1 DSA (Mar 2026): Coin Change and longest substring without repeating characters; feedback positive.
Given a string s, return the length of the longest substring (contiguous) in which no character repeats.
This is LeetCode 3 — Longest Substring Without Repeating Characters.
Example
"abcabcbb" -> 3 ("abc")
"bbbbb" -> 1
"pwwkew" -> 3 ("wke"; "pwke" is a subsequence, not a substring)
Constraints: 0 ≤ s.length ≤ 5·10^4; letters, digits, symbols and spaces.
Code runner format: one line with s as a JSON string. Implement lengthOfLongestSubstring(s); the harness prints the length.