<commit_before>vector<int> z(string s) {
  int n = s.size();
  vector<int> z(n);
  int x = 0, y = 0;
  for (int i = 1; i < n; i++) {
    z[i] = max(0,min(z[i-x],y-i+1));
    while (i+z[i] < n && s[z[i]] == s[i+z[i]]) {
      x = i; y = i+z[i]; z[i]++;
     }
  }
  return z;
}<commit_msg>Update z.cpp<commit_after>// Z-Function - O(n)

vector<int> z(string s){
  vector<int> z(s.size());
  for(int i = 1, l = 0, r = 0, n = s.size(); i < n; i++){
    if(i <= r) z[i] = min(z[i-l], r - i + 1);
    while(i + z[i] < n and s[z[i]] == s[z[i] + i]) z[i]++;
    if(i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
{'fraction_non_alphanumeric': 0.2896440129449838, 'fraction_numerical': 0.01779935275080906, 'mean_word_length': 2.3101604278074865, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4282162', 'n_tokens_mistral': 333, 'n_tokens_neox': 323, 'n_words': 82}