Update counter.rb

reduced 3 combo to 2 loops instead of 3, will test soon.