Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
f=->d{s=0;7.times{|i|c=d.count i;i==1&&i=10;s+=c>2?c/3*i*100:1>i%5?c%3*i*10:0};s}

p f.call [1, 2, 3, 4, 5, 6]
p f.call [1, 1, 1, 2, 3, 5]
p f.call [1, 1, 1, 1, 1, 1]
p f.call [2, 2, 2, 2, 2, 2]
p f.call [6, 6, 1, 5, 5, 6]
p f.call [2, 3, 4, 6, 2, 4]
p f.call [1, 5, 1, 5, 1, 5]
p f.call [5, 5, 5, 5, 2, 3]
p f.call [1, 1, 1, 1, 1, 5]
p f.call [3, 3, 4, 4, 3, 4]
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]