34. 在排序数组中查找元素的第一个和最后一个位置
https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/ 给定一个按照升序排列的整数数组 nums,和一个目标值 ta…
https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/ 给定一个按照升序排列的整数数组 nums,和一个目标值 ta…
https://leetcode-cn.com/problems/shortest-path-in-binary-matrix 在一个 N × N 的方形网格中,每个单元格有两种状态:空(0)或者阻塞(1)。 一条从左上角到右下角、长度为…
官方链接 https://leetcode-cn.com/problems/n-th-tribonacci-number 泰波那契序列 Tn 定义如下: T0 = 0, T1 = 1, T2 = 1, 且在 n = 0 的条件下 Tn+3…
https://leetcode-cn.com/problems/longest-common-subsequence 给定两个字符串 text1 和 text2,返回这两个字符串的最长公共子序列。 一个字符串的 子序列 是指这样一个新的字…
https://leetcode-cn.com/problems/search-in-rotated-sorted-array/ 假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组 可能变为 )。 搜索一个给定的…
https://leetcode-cn.com/problems/longest-valid-parentheses 给定一个只包含 '(' 和 ')' 的字符串,找出最长的包含有效括号的子串的长度。 示例 1: 示例 2: 暴力解法(超出…
https://leetcode-cn.com/problems/generate-parentheses 给出 n 代表生成括号的对数,请你写出一个函数,使其能够生成所有可能的并且有效的括号组合。 例如,给出 n = 3,生成结果为: 1…
https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/ 给定一个仅包含数字 2-9 的字符串,返回所有它能表示的字母组合。 给出数字到字母的映射如下(与…
https://leetcode-cn.com/problems/longest-common-prefix/ 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串 ""。 示例 1: 示例 2: 说明: 所有输…
https://leetcode-cn.com/problems/regular-expression-matching/ 给你一个字符串 s 和一个字符规律 p,请你来实现一个支持 '.' 和 '' 的正则表达式匹配。 说明: 示例 1:…
第 13 / 29 页 · 共 288 篇