<commit_before>class Problem019

  def count_sundays(year_range)
    year_range = year_range..year_range if year_range.kind_of?(Integer)
    (1..12).to_a.product(year_range.to_a).count { |month, year| Time.new(year, month, 1).sunday? }
  end

  def run
    count_sundays(1901..2000)
  end
end

if $0 == __FILE__
  puts "Result: #{Problem019.new.run}"
end
<commit_msg>more intention revealing version of prb 19<commit_after>class Problem019

  class ::Range
    def product(other)
      self.to_a.product(other.to_a)
    end
    alias :* :product
  end

  def count_sundays(year_range)
    year_range = year_range..year_range if year_range.kind_of?(Integer)
    ((1..12) * year_range).count { |month, year| Time.new(year, month, 1).sunday? }
  end

  def run
    count_sundays(1901..2000)
  end
end

if $0 == __FILE__
  puts "Result: #{Problem019.new.run}"
end

{'fraction_non_alphanumeric': 0.12040133779264214, 'fraction_numerical': 0.044593088071348944, 'mean_word_length': 3.063348416289593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1259047', 'n_tokens_mistral': 382, 'n_tokens_neox': 330, 'n_words': 70}