message: Update reduce-array-size-to-the-half.py
diff: @@ -16,9 +16,12 @@ class Solution(object):
  counting_sort[c-1] += 1
  result, total = 0, 0
  for c in reversed(xrange(len(arr))):
  - for _ in xrange(counting_sort[c]):
  - result += 1
  - total += c+1
  - if total*2 >= len(arr):
  - return result
  + if not counting_sort[c]:
  + continue
  + count = min(counting_sort[c],
  + ((len(arr)+1)//2 - total - 1)//(c+1) + 1)
  + result += count
  + total += count*(c+1)
  + if total >= (len(arr)+1)//2:
  + break
  return result
  