Bounded Repeat Substring
Microsoft interview questions · Medium · Coding round · 6 tests
Readings from a sensor are given as a string s. Call a contiguous piece of
s valid when nowhere inside it does the same character occur
three times in a row.
Your function should report how long the longest valid substring is.
Function
Run your code with Ctrl+Enter to see results.