Ctrl K

Parcel Handling Class

Easy
At a sorting hub every parcel gets a tag that decides which conveyor it rides. A parcel is a rectangular box with sides x, y, z and weight weight. - A parcel is **bulky** if at least one side is 10⁴ or more, or if its volume x · y · z is 10⁹ or more. - A parcel is **heavy** if weight is 100 or more. Return the tag as a string: - "Both": bulky and heavy at once; - "Bulky": bulky only; - "Heavy": heavy only; - "Neither": neither of the two.
Example 1
x=20000, y=3, z=4, weight=12 → 'Bulky'

One side is 20000 ≥ 10⁴, so the parcel is "Bulky"; the weight of 12 is under 100.

Example 2
x=1000, y=1000, z=1000, weight=150 → 'Both'

Every side is under 10⁴, but the volume is exactly 10⁹, so it is bulky, and a weight of 150 makes it heavy too: "Both".

Example 3
x=40, y=30, z=20, weight=99 → 'Neither'
Constraints
  • 1 ≤ x, y, z ≤ 10⁵
  • 1 ≤ weight ≤ 1000
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsA Number That Reads Both Ways EasyValue of a Roman Numeral EasyAdd One to a Digit Array EasySum of Binary Strings EasyWhole Square Root Easy
loading Python…
Input
x=20000, y=3, z=4, weight=12
Expected
'Bulky'

Run checks the first 3 tests in your browser. Submit checks all 106 tests on the server, hidden ones included.