Length of minimized Compressed String

  #include using namespace std;  vector prefix_function(string s){      int n = (int)s.length();      vector pi(n);      for (int i = 1; i < n; i++) {          int j = pi[i - 1];          while (j > 0 && s[i] != s[j])            j = pi[j – 1];        if (s[i] == s[j])            j++;        pi[i] = j;    }      return pi;}  void minLength(string s, int n){        vector dp(n + 1, vector(n + 1, 10000));          for (int l = 1; l