Skip to content

Instantly share code, notes, and snippets.

@sunchen115
sunchen115 / pager.rb
Last active September 18, 2017 03:30
require 'date'
def days_between(date1, date2)
d1 = Date.parse(date1)
d2 = Date.parse(date2)
(d2 - d1).to_i
end
ss=%w{JP OYJC欧阳继超 FJ冯佳 SC孙晨}.sort
pairs=[]
ss.each do |e1|
ss.each do |e2|
if e1 != e2
pairs<<[e1,e2].sort unless pairs.include?([e1,e2].sort)
end
end
end