上一页 1 ··· 73 74 75 76 77 78 79 80 81 ··· 125 下一页

2020年5月9日

摘要: 地址 https://leetcode-cn.com/problems/decode-string/ 给定一个经过编码的字符串,返回它解码后的字符串。 编码规则为: k[encoded_string],表示其中方括号内部的 encoded_string 正好重复 k 次。注意 k 保证为正整数。 你 阅读全文
posted @ 2020-05-09 20:36 itdef 阅读(278) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/binary-tree-paths/ 给定一个二叉树,返回所有从根节点到叶子节点的路径。 说明: 叶子节点是指没有子节点的节点。 示例: 输入: 1 / \ 2 3 \ 5 输出: ["1->2->5", "1->3"] 解释: 阅读全文
posted @ 2020-05-09 12:28 itdef 阅读(219) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/sqrtx/ 实现 int sqrt(int x) 函数。 计算并返回 x 的平方根,其中 x 是非负整数。 由于返回类型是整数,结果只保留整数的部分,小数部分将被舍去。 示例 1: 输入: 4 输出: 2 示例 2: 输入: 阅读全文
posted @ 2020-05-09 11:14 itdef 阅读(172) 评论(0) 推荐(0)

2020年5月7日

摘要: 地址 https://leetcode-cn.com/problems/letter-case-permutation/ 给定一个字符串S,通过将字符串S中的每个字母转变大小写,我们可以获得一个新的字符串。返回所有可能得到的字符串集合。 示例: 输入: S = "a1b2" 输出: ["a1b2", 阅读全文
posted @ 2020-05-07 23:00 itdef 阅读(315) 评论(0) 推荐(0)
摘要: 恢复内容开始 地址 https://leetcode-cn.com/problems/gas-station/ 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从 阅读全文
posted @ 2020-05-07 18:52 itdef 阅读(234) 评论(0) 推荐(0)

2020年5月5日

摘要: 地址 https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/ 给你一个整数数组 nums ,和一个表示限制的整数 limit,请你返回最长 阅读全文
posted @ 2020-05-05 20:45 itdef 阅读(462) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/queue-reconstruction-by-height/ 假设有打乱顺序的一群人站成一个队列。 每个人由一个整数对(h, k)表示,其中h是这个人的身高,k是排在这个人前面且身高大于或等于h的人数。 编写一个算法来重建这个 阅读全文
posted @ 2020-05-05 17:39 itdef 阅读(277) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/validate-binary-search-tree/ 给定一个二叉树,判断其是否是一个有效的二叉搜索树。 假设一个二叉搜索树具有如下特征: 节点的左子树只包含小于当前节点的数。 节点的右子树只包含大于当前节点的数。 所有左子 阅读全文
posted @ 2020-05-05 13:03 itdef 阅读(166) 评论(0) 推荐(0)

2020年5月4日

摘要: 地址 https://leetcode-cn.com/problems/jump-game-ii/ 给定一个非负整数数组,你最初位于数组的第一个位置。 数组中的每个元素代表你在该位置可以跳跃的最大长度。 你的目标是使用最少的跳跃次数到达数组的最后一个位置。 示例: 输入: [2,3,1,1,4] 输 阅读全文
posted @ 2020-05-04 15:45 itdef 阅读(148) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/jump-game/ 给定一个非负整数数组,你最初位于数组的第一个位置。 数组中的每个元素代表你在该位置可以跳跃的最大长度。 判断你是否能够到达最后一个位置。 示例 1: 输入: [2,3,1,1,4] 输出: true 解释: 阅读全文
posted @ 2020-05-04 12:50 itdef 阅读(133) 评论(0) 推荐(0)
上一页 1 ··· 73 74 75 76 77 78 79 80 81 ··· 125 下一页

导航