Abridged Statement: Given the string consisting of characters $$$0,1,2$$$, we have to find the maximum amount of disjoint subsequences equal to $$$2020$$$.
My idea was to (while possible, with restarting) greedly take from left to right as many 2020-s as possible. I first tried the naive version of this, but got WA instead of TLE.
Looking for the full solution. Thanks.