每日一题 2525. 根据规则将箱子分类 (简单)

每日一题 2525. 根据规则将箱子分类 (简单)_第1张图片
简单题,直接分类就好

class Solution:
    def categorizeBox(self, length: int, width: int, height: int, mass: int) -> str:
        if length >= 10**4 or width >= 10**4 or height >= 10**4 or length*width*height >= 10**9:
            return "Both" if mass >= 100 else "Bulky"
        else:
            return "Heavy" if mass >= 100 else "Neither"

你可能感兴趣的:(用Python刷力扣,算法,python,leetcode)