<commit_before>#include <iostream>
#include <vector>
#include <iterator>

using std::begin; using std::end; using std::cout; using std::endl; using std::vector;

// pb point to begin of the array, pe point to end of the array.
bool compare(int* const pb1, int* const pe1, int* const pb2, int* const pe2)
{
  if ((pe1 - pb1) != (pe2 - pb2)) // have different size.
    return false;
  else
  {
    for (int* i = pb1, *j = pb2; (i != pe1)&&(j != pe2); ++i, ++j)
      if (*i != *j) return false;
  }
  
  return true;
}

int main()
{
    int arr1[3] = {0, 1, 2};
    int arr2[3] = {0, 2, 4};
    
    if (compare(begin(arr1), end(arr1), begin(arr2), end(arr2)))
      cout << "The two arrays are equal." << endl;
    else
      cout << "The two arrays are not equal." << endl;
      
    cout << "==========" << endl;
      
    vector<int> vec1 = {0, 1, 2};
    vector<int> vec2 = {0, 1, 2};
    
    if (vec1 == vec2)
      cout << "The two vectors are equal." << endl;
    else
      cout << "The two vectors are not equal." << endl;

    return 0;
}<commit_msg>Update ex3_36.cpp<commit_after>#include <iostream>
#include <vector>
using std::begin; using std::end; using std::cout; using std::endl; using std::vector; using std::size_t;

bool compare(const int lhs[], size_t lsize, const int rhs[], size_t rsize)
{
    if (lsize != rsize) return false;
    for (int i = 0; i != lsize; ++i)
        if (lhs[i] != rhs[i]) return false;
    return true;
}

bool compare(vector<int> const& lhs, vector<int>& rhs)
{
    return lhs == rhs;
}

int main()
{
    int arr1[3] = { 0, 1, 2 };
    int arr2[3] = { 0, 2, 4 };
    auto result = compare(arr1, sizeof(arr1) / sizeof(arr2[1]), arr2, sizeof(arr2[0]));
    cout << "The two arrays are " << (result ? "equal\n" : "unequal\n");

    vector<int> vec1 = { 0, 1, 2 };
    vector<int> vec2 = { 0, 1, 2 };
    result = compare(vec1, vec2);
    cout << "The two vectors are " << (result ? "equal\n" : "unequal\n");

    return 0;
}
{'fraction_non_alphanumeric': 0.1856925418569254, 'fraction_numerical': 0.0350076103500761, 'mean_word_length': 2.844054580896686, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 14, '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': '5851386', 'n_tokens_mistral': 769, 'n_tokens_neox': 748, 'n_words': 244}