Categorize Box According to Criteria
easy · verified · 38.7% accepted · 238 likes · top 18%
Description
Given four integers length, width, height, and mass, representing the dimensions and mass of a box, respectively, return a string representing the category of the box.
- The box is "Bulky" if:
- Any of the dimensions of the box is greater or equal to 104.
- Or, the volume of the box is greater or equal to 109.
- If the mass of the box is greater or equal to 100, it is "Heavy".
- If the box is both "Bulky" and "Heavy", then its category is "Both".
- If the box is neither "Bulky" nor "Heavy", then its category is "Neither".
- If the box is "Bulky" but not "Heavy", then its category is "Bulky".
- If the box is "Heavy" but not "Bulky", then its category is "Heavy".
Note that the volume of the box is the product of its length, width and height.
Example 1:
Example 2:
Solution