leetcode-165周赛-1276-不浪费原料的汉堡制作方案

题目描述:

 

 

 

 

 

 自己的提交:

class Solution:
    def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]:
        t = (tomatoSlices - 2 * cheeseSlices) / 2
        c = cheeseSlices - t
        if t % 1 != 0 or t < 0 or c < 0:
            return []
        return [int(t),int(c)]
        

 

posted @ 2019-12-02 18:27  oldby  阅读(138)  评论(0编辑  收藏  举报