Skip to content

Instantly share code, notes, and snippets.

@riniculous
Created March 25, 2025 00:11
Show Gist options
  • Save riniculous/214f328f425bf2db45e0f19a971d4710 to your computer and use it in GitHub Desktop.
Save riniculous/214f328f425bf2db45e0f19a971d4710 to your computer and use it in GitHub Desktop.
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