#3628

Maximum Number of Subsequences After One Inserting

expert · 1105 · lc medium +32 · 31.7% accepted · 129 likes · top 9%

Description

Given a string s of uppercase English letters, you may insert at most one uppercase letter anywhere (including at the start or end).

Return the maximum number of "LCT" subsequences in the resulting string.

Code

1
2
3