LeetCodeMetaData / categorize-box-according-to-criteria.json
DataRepo's picture
Upload part 1 of 2
4097b71 verified
{
"id": 2619,
"name": "categorize-box-according-to-criteria",
"difficulty": "Easy",
"link": "https://leetcode.com/problems/categorize-box-according-to-criteria/",
"date": "2022-12-24",
"task_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:** ``` **Input:** length = 1000, width = 35, height = 700, mass = 300 **Output:** \"Heavy\" **Explanation:** None of the dimensions of the box is greater or equal to 104. Its volume = 24500000 <= 109. So it cannot be categorized as \"Bulky\". However mass >= 100, so the box is \"Heavy\". Since the box is not \"Bulky\" but \"Heavy\", we return \"Heavy\". ``` **Example 2:** ``` **Input:** length = 200, width = 50, height = 800, mass = 50 **Output:** \"Neither\" **Explanation:** None of the dimensions of the box is greater or equal to 104. Its volume = 8 * 106 <= 109. So it cannot be categorized as \"Bulky\". Its mass is also less than 100, so it cannot be categorized as \"Heavy\" either. Since its neither of the two above categories, we return \"Neither\". ``` **Constraints:** `1 <= length, width, height <= 105` `1 <= mass <= 103`",
"test_case": [
{
"label": "Example 1",
"input": "length = 1000, width = 35, height = 700, mass = 300",
"output": "\"Heavy\" "
},
{
"label": "Example 2",
"input": "length = 200, width = 50, height = 800, mass = 50",
"output": "\"Neither\" "
}
],
"constraints": [
"The box is \"Bulky\" if:\n\n\t\nAny of the dimensions of the box is greater or equal to 104.\nOr, the volume of the box is greater or equal to 109.",
"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\".",
"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.",
"1 <= length, width, height <= 105",
"1 <= mass <= 103"
],
"python_template": "class Solution(object):\n def categorizeBox(self, length, width, height, mass):\n \"\"\"\n :type length: int\n :type width: int\n :type height: int\n :type mass: int\n :rtype: str\n \"\"\"\n ",
"java_template": "class Solution {\n public String categorizeBox(int length, int width, int height, int mass) {\n \n }\n}",
"metadata": {
"func_name": "categorizeBox"
}
}