Update sort.rb

updated counting_sort to have more intelligent number range guessing