From b4865e62df4d063286b25d460082bc8f8a060411 Mon Sep 17 00:00:00 2001 From: Jinyoung Jeong <80400463+jyoung2419@users.noreply.github.com> Date: Wed, 9 Sep 2026 22:36:46 +0900 Subject: [PATCH] Add categorizeBox function for box classification Implement categorizeBox function to classify boxes based on dimensions and mass. --- ...525. Categorize Box According to Criteria" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "leetcode3/\354\240\225\354\247\204\354\230\201/2525. Categorize Box According to Criteria" diff --git "a/leetcode3/\354\240\225\354\247\204\354\230\201/2525. Categorize Box According to Criteria" "b/leetcode3/\354\240\225\354\247\204\354\230\201/2525. Categorize Box According to Criteria" new file mode 100644 index 00000000..cd284007 --- /dev/null +++ "b/leetcode3/\354\240\225\354\247\204\354\230\201/2525. Categorize Box According to Criteria" @@ -0,0 +1,20 @@ +/** + * @param {number} length + * @param {number} width + * @param {number} height + * @param {number} mass + * @return {string} + */ + + // 시간 복잡도 O(1) +var categorizeBox = function(length, width, height, mass) { + let volume = length * width * height; + if ((volume >= 10**9 || length >= 10**4 || width >= 10**4 || height >= 10**4) && (mass>=100)){ + return "Both"; + } else if (mass >= 100){ + return "Heavy"; + } else if (volume >= 10**9 || length >= 10**4 || width >= 10**4 || height >= 10**4){ + return "Bulky"; + } + else { return "Neither" }; +};