Created
March 25, 2025 00:11
-
-
Save riniculous/214f328f425bf2db45e0f19a971d4710 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortPackage(width: number, height: number, length: number, mass: number): string { | |
const volume = width * height * length; | |
const isBulky = volume >= 1000000 || width >= 150 || height >= 150 || length >= 150; | |
const isHeavy = mass >= 20; | |
if (isBulky && isHeavy) { | |
return "REJECTED"; | |
} else if (isBulky || isHeavy) { | |
return "SPECIAL"; | |
} else { | |
return "STANDARD"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment