Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1156. Swap For Longest Repeated Character Substring
Given a lowercase string where you may swap any two characters once, find the maximum length of a substring consisting of the same character after at most one swap. Think in terms of run-length groups and character counts: you can extend a run with extra occurrences elsewhere or merge two same-character runs separated by a single different char when a spare character exists.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.