32*18=576 oz.
Store A offers 24-12 oz cans for $5.89. That means $5.89 gets you 288 oz. Store B offers 12-12oz cans for $3.79, so that means $3.79 gets you 144oz.
Store A is $5.89 per every 288 oz. You need 576 oz, which is double that. That means it will cost you twice as much as it would buying 24-12 oz cans:
$5.89*2=$11.78
Store B is $3.79 for 144 oz. As previously stated, you need 576 oz, so you'll need to buy 4 12-packs of 12 oz cans:
$3.79*4=15.16
So not only is Store A a better deal, but they'll save you $15.16-$11.78=$3.38 dollars.