#R, <s>102</s>, 91 bytes f=function(b,v,s=table(v))(90*any(s>1)+100*all(s==2)+200*any(s>2)+477*any(s>3)+b+10)%/%100 Managed to drop 11 bytes (and fix a bug) thanks to @Giuseppe. Ungolfed f=function(b,v){ s=table(v) #Built into function inputs to remove 2 bytes a=10+b+ #adds coins (b) and covers default of no matches 90*any(s==2)+ #covers 1 pair, starts sums for rest of matches 100*all(s==2)+ #covers sum for 2 pair 290*any(s>2)+ #covers sum for 3 of a kind, continues for 4 of a kind 477*any(s>3) #covers sum for 4 of a kind a%/%100 #division without remainder }