码迷,mamicode.com
首页 >  
搜索关键字:leetcode 19    ( 34993个结果
[LeetCode] 1089. Duplicate Zeros 复写零
Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond ...
分类:其他好文   时间:2021-03-30 12:46:57    阅读次数:0
03_02_leetcode_11_盛最多的水
1.题目描述 给你 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0) 。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 说明:你不能倾斜容器 示例 1: ...
分类:其他好文   时间:2021-03-29 12:37:26    阅读次数:0
LeetCode——242. 有效的字母异位词(Java)
题目描述 题干: 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 示例1: 输入: s = "anagram", t = "nagaram" 输出: true 示例2: 输入: s = "rat", t = "car" 输出: false 题解思路 如果两个字符串字 ...
分类:编程语言   时间:2021-03-29 12:21:18    阅读次数:0
LeetCode-动态规划篇
动态规划 重叠子问题、最优子结构、状态转移方程就是动态规划三要素 思考状态转移方程: 明确 base case → 明确「状态」-> 明确「选择」 → 定义 dp 数组/函数的含义。 # 初始化 base case dp[0][0][...] = base # 进行状态转移 for 状态1 in 状 ...
分类:其他好文   时间:2021-03-29 12:05:58    阅读次数:0
LeetCode 43. 字符串相乘
43. 字符串相乘 Difficulty: 中等 给定两个以字符串形式表示的非负整数 num1 和 num2,返回 num1 和 num2 的乘积,它们的乘积也表示为字符串形式。 示例 1: 输入: num1 = "2", num2 = "3" 输出: "6" 示例 2: 输入: num1 = "1 ...
分类:其他好文   时间:2021-03-29 11:46:13    阅读次数:0
【LeetCode-518】零钱兑换 II
问题 给定不同面额的硬币和一个总金额。写出函数来计算可以凑成总金额的硬币组合数。假设每一种面额的硬币有无限个。 示例 输入: amount = 5, coins = [1, 2, 5] 输出: 4 解释: 有四种方式可以凑成总金额: 5=5 5=2+2+1 5=2+1+1+1 5=1+1+1+1+1 ...
分类:其他好文   时间:2021-03-26 15:29:36    阅读次数:0
Leetcode 111. Minimum Depth of Binary Tree
Description:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to t ...
分类:其他好文   时间:2021-03-18 14:37:13    阅读次数:0
[LeetCode] 670. Maximum Swap
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. ...
分类:其他好文   时间:2021-03-18 14:32:17    阅读次数:0
LeetCode 54. 螺旋矩阵
54. 螺旋矩阵 Difficulty: 中等 给你一个 m 行 n 列的矩阵 matrix ,请按照 顺时针螺旋顺序 ,返回矩阵中的所有元素。 示例 1: 输入:matrix = [[1,2,3],[4,5,6],[7,8,9]] 输出:[1,2,3,6,9,8,7,4,5] 示例 2: 输入:m ...
分类:其他好文   时间:2021-03-17 14:59:57    阅读次数:0
【python】Leetcode每日一题-螺旋矩阵2
【python】Leetcode每日一题-螺旋矩阵2 【题目描述】 给你一个正整数 n ,生成一个包含 1 到 n2 所有元素,且元素按顺时针顺序螺旋排列的 n x n 正方形矩阵 matrix 。 示例1: 输入:n = 3 输出:[[1,2,3],[8,9,4],[7,6,5]] 示例2: 输入 ...
分类:编程语言   时间:2021-03-17 14:59:30    阅读次数:0
34993条   上一页 1 ... 25 26 27 28 29 ... 3500 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!