calculate each type item cost by barcode_counts_array
pass test