2730. Find the Longest Semi-Repetitive Substring
You are given a 0-indexed string
sthat consists of digits from0to9.A string
tis called a semi-repetitive if there is at most one consecutive pair of the same digits insidet.Return the length of the longest semi-repetitive substring inside
s.A substring is a contiguous non-empty sequence of characters within a string.