地址 https://leetcode-cn.com/problems/number-of-burgers-with-no-waste-of-ingredients/ 目描述圣诞活动预热开始啦,汉堡店推出了全新的汉堡套餐.为了避免浪费原料,请你帮他们制定合适的制作计划. 给你两个整数 tomatoSlices 和 cheeseSlices,分别表示番茄片和奶酪片的数目.不同汉堡的原料搭配如下: 巨无霸汉堡:4 片番茄和 1 片奶酪小皇堡:2 片番茄和 1 片奶酪请你以 [total_jumbo,…
题目描述: 自己的提交: 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)]…
题目如下: Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows: Jumbo Burger: 4 tomato slices and 1 cheese slice. Small Burger: 2 Tomato slices and 1 cheese slice. Return [total_jumbo, total_small] so that…
----com.threeapp.MakerHanBao01----儿童汉堡制作游戏…
[js]Leetcode每日一题-停在原地的方案数 [题目描述] 有一个长度为 arrLen 的数组,开始有一个指针在索引 0 处. 每一步操作中,你可以将指针向左或向右移动 1 步,或者停在原地(指针不能被移动到数组范围外). 给你两个整数 steps 和 arrLen ,请你计算并返回:在恰好执行 steps 次操作以后,指针仍然指向索引 0 处的方案数. 由于答案可能会很大,请返回方案数 模 10^9 + 7 后的结果. 示例1: 输入:steps = 3, arrLen = 2 输出:4…
171. Excel表列序号 171. Excel Sheet Column Number 题目描述 给定一个 Excel 表格中的列名称,返回其相应的列序号. 每日一算法2019/5/25Day 22LeetCode171. Excel Sheet Column Number 例如, A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... 示例 1: 输入: "A" 输出: 1 示例 2: 输入…
描述 Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n). Example 1: Input: [3, 2, 1] Output: 1 Explanation: The third maximum is 1. Ex…
题目描述: Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB Excel Sheet Column Number Related to question Exc…
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB 思路: 相当于10进制转26进制.与一般不一样的是10进制对应的是0 - 9.而这个26进制对应的是 A(1)- Z(26), 没有0. 我的代码: strin…
Problem: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string "23" Output: ["ad", "ae&…