Leetcode Problem 2525. Categorize Box According to Criteria

2525. Categorize Box According to Criteria

Leetcode Solutions

Check Bulky and Heavy Conditions

  1. Check if any of the dimensions (length, width, height) is greater than or equal to 104.
  2. Calculate the volume of the box by multiplying length, width, and height.
  3. Check if the volume is greater than or equal to 109.
  4. If either condition 1 or 2 is true, the box is bulky.
  5. Check if the mass is greater than or equal to 100.
  6. If true, the box is heavy.
  7. Based on the bulky and heavy flags, return the appropriate category string: 'Bulky', 'Heavy', 'Both', or 'Neither'.
UML Thumbnail

Separate Functions for Bulky and Heavy Checks

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...