<commit_before>#coding: utf-8

#Question: 
# => https://oj.leetcode.com/problems/two-sum/

def two_sum(numbers,target)
  numbers.each_with_index  do |item1,index1|
    index1 = index1 + 1
    numbers[index1..numbers.length].each_with_index do |item2,index2|
      index2 = index2 + 1
      if item1 + item2 == target
        return [index1,index1+index2]
      end
    end
  end
end

puts "two_sum([2,7,11,15],9) => #{two_sum([2,7,11,15],9)}"<commit_msg>add null return<commit_after>#coding: utf-8

#Question: 
# => https://oj.leetcode.com/problems/two-sum/

def two_sum(numbers,target)
  numbers.each_with_index  do |item1,index1|
    index1 = index1 + 1
    numbers[index1..numbers.length].each_with_index do |item2,index2|
      index2 = index2 + 1
      return [index1,index1+index2] if item1 + item2 == target        
    end
  end
  
  [nil,nil]
end

puts "two_sum([2,8,11,15],9) => #{two_sum([2,8,11,15],9)}"
{'fraction_non_alphanumeric': 0.15628415300546447, 'fraction_numerical': 0.06775956284153005, 'mean_word_length': 3.5346534653465347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6156586', 'n_tokens_mistral': 390, 'n_tokens_neox': 369, 'n_words': 63}