[LeetCode] Find the Longest Semi-Repetitive Substring

1 · · June 10, 2023, 3:10 p.m.
2730. Find the Longest Semi-Repetitive Substring You are given a 0-indexed string s that consists of digits from 0 to 9. A string t is called a semi-repetitive if there is at most one consecutive pair of the same digits inside t. Return the length of the longest semi-repetitive substring inside s. A substring is a contiguous non-empty sequence of characters within a string. ...