3016. Minimum Number of Pushes to Type Word II - Explanation

Problem Link