def custom_sort(enumerable)
      sorted_array = enumerable.sort_by do |key, _|
        key.sub(/^the\s*/i, '').downcase
      end

      # sort_by() returns an array when called on hashes.
      if enumerable.kind_of?(Hash)
        # Rebuild the hash.
        sorted_hash = {}
        sorted_array.each { |item| sorted_hash[item[0]] = item[1] }
        sorted_hash
      else
        sorted_array
      end
    end
def custom_sort(enumerable)
      sorted_array = enumerable.sort_by do |key, _|
        key.sub(/^the\s*/i, '').downcase
      end

      # sort_by() returns an array when called on hashes.
      if enumerable.kind_of?(Hash)
        # Rebuild the hash.
        sorted_hash = {}
        sorted_array.each { |item| sorted_hash[item[0]] = item[1] }
        sorted_hash
      else
        sorted_array
      end
    end
Sorts alphabetically ignoring the initial 'The' when sorting strings.
 Also case-insensitive to prevent lowercase names from being sorted last.
 @param enumerable [Array, Hash]
 @return [Array, Hash]