dates = [
    [, 15],
    [, 16],
    [, 19],
    [, 17],
    [, 18],
    [, 14],
    [, 16],
    [, 14],
    [, 15],
    [, 17],
]

print dates.length, 


uniqueMonths = dates.group_by { |m,d| d }
                    .select { |k,v| v.size == 1 }
                    .map { |k,v| v.flatten }
                    .map { |m,d| m }
dates.delete_if { |m,d| uniqueMonths.include? m }
print dates.length, 


dates = dates   .group_by { |m,d| d }
                .select { |k,v| v.size == 1 }
                .map { |k,v| v.flatten }
print dates.length, 


dates = dates   .group_by { |m,d| m }
                .select { |k,v| v.size == 1 }
                .map { |k,v| v }
                .flatten
print dates