Company: COMCAST_13thjuly
Difficulty: medium
A pet supply store uses specific unit symbols to represent quantities of different pet items, which are defined as follows: 'f' = bags of dog food → ₹800 per unit. 't' = liters of fish tank water → ₹50 per unit. 'c' = cat toys → ₹200 per unit. 'b' = boxes of pet treats → ₹1200 per unit. You are given a string S that encodes the list of pet items, and your task is to find and return an integer value representing the total cost of all items in S. Note: If a unit appears without a number before it, it is assumed to represent a single unit (i.e., quantity = 1). If a number is not followed by a valid unit, treat it as a plain number and add it directly to the total cost. Input Specification: input1 : A string S consisting of the quantities and units of 'f', 't', 'c', and 'b'.