O(n) algorithm for sorting an array of people by their birthdsays