Absolutely No Need for DP


#1

We can simply work with the minimum requirement of 2 character sub-sequence and using simple unordered maps, we can solve it in O(n).