>>537 Ruby
date = (3..9).flat_map do |mo|
  [*1..2].permutation.flat_map do |dd, dh|
    ([*3..5] - [mo]).permutation(2).flat_map do |dm, ds|
      ([*3..9] - [mo, dm, ds]).permutation.map do |d, h, m, s|
        [0, mo, dd, d, dh, h, dm, m, ds, s] if dh == 1 || h < 4
      end
    end
  end
end.compact

p date.size
# => 768
puts date.map(&:join)
# => 0326174859
0326174958
0326184759
0326184957
0326194758
0326194857
0327164859
0327164958
0327184659
0327184956
... 略