(Photo) How could I find items separated by stacks within my inventory to craft another item?

Perhaps setup a counter variable/map for required items, query the array for the item and addit to that count.