Editorial for HHPC1 P1 - Yielding the Longest Substring
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Case 1 (Increasing the length of a substring of identical characters by one):
The answer will simply be the
Time complexity:
Case 2 (Replacing a letter to connect two substrings of identical characters on the sides):
Find the positions that satisfy the condition
Since each subarray with identical characters will only be iterated from the left or the right, it can be proven that the total time complexity does not exceed
Overall time complexity for each test case:
Comments