int s_length = s.length(); if (s_length == 0) { return s; } vector<vector<int>> state(s_length, vector<int>(s_length)); int max_len = 0; string max_s = "";
for (int len = 1; len <= s_length; len++) { for (int start = 0; start < s_length; start++) { int end = start + len - 1; if (end >= s_length) { break; }