leetcode
文章平均质量分 88
红鲤鱼遇绿鲤鱼
只要思想不滑坡,办法总比困难多~
展开
-
leetcode 1139 最大的以 1 为边界的正方形
原题:给你一个由若干 0 和 1 组成的二维网格 grid,请你找出边界全部由 1 组成的最大 正方形 子网格,并返回该子网格中的元素数量。如果不存在,则返回 0。示例 1:输入:grid = [[1,1,1],[1,0,1],[1,1,1]]输出:9示例 2:输入:grid = [[1,1,0,0]]输出:1提示:1 <= grid.length <= 1001 <= grid[0].length <= 100grid[i][j] 为 0 或 1代码:c原创 2020-07-05 17:41:03 · 217 阅读 · 0 评论 -
leetcode 1000 合并石头的最低成本
原题:有 N 堆石头排成一排,第 i 堆中有 stones[i] 块石头。每次移动(move)需要将连续的 K 堆石头合并为一堆,而这个移动的成本为这 K 堆石头的总数。找出把所有石头合并成一堆的最低成本。如果不可能,返回 -1 。示例 1:输入:stones = [3,2,4,1], K = 2输出:20解释:从 [3, 2, 4, 1] 开始。合并 [3, 2],成本为 5,...原创 2020-02-06 20:13:28 · 1059 阅读 · 1 评论 -
leetcode 312 戳气球
原题:有 n 个气球,编号为0 到 n-1,每个气球上都标有一个数字,这些数字存在数组 nums 中。现在要求你戳破所有的气球。每当你戳破一个气球 i 时,你可以获得 nums[left] * nums[i] * nums[right] 个硬币。 这里的 left 和 right 代表和 i 相邻的两个气球的序号。注意当你戳破了气球 i 后,气球 left 和气球 right 就变成了相邻的气...原创 2020-02-06 18:41:26 · 290 阅读 · 1 评论 -
leetcode 3 Longest Substring Without Repeating Characters
原题: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3....原创 2016-01-30 23:45:20 · 340 阅读 · 0 评论 -
LeetCode 2 Add Two Numbers
原题:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and retu...原创 2018-09-18 00:34:56 · 645 阅读 · 0 评论 -
leetcode 8 . String to Integer (atoi)
原题:Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from ...原创 2018-09-27 11:50:20 · 172 阅读 · 0 评论 -
Leetcode 32 Longest valid paraentheses
原题:Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: “(()”Output: 2Explanation: The longest vali...原创 2018-10-19 10:52:08 · 154 阅读 · 0 评论 -
Leetcode 72 Edit Distance
原题:Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.You have the following 3 operations permitted on a word:Insert a characterDelete a char...原创 2018-11-01 22:27:07 · 176 阅读 · 0 评论 -
leetcode 97 Interleaving String
原题:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.Example 1:Input: s1 = “aabcc”, s2 = “dbbca”, s3 = “aadbbcbcac”Output: trueExample 2:Input: s1 = “aabcc”, s2 = “dbb...原创 2018-11-04 15:23:23 · 140 阅读 · 0 评论 -
leetcde 115 Distinct Subsequences
原题:Given a string S and a string T, count the number of distinct subsequences of S which equals T.A subsequence of a string is a new string which is formed from the original string by deleting some ...原创 2019-02-03 17:30:01 · 166 阅读 · 0 评论 -
leetcode 82. Remove Duplicates from Sorted List II
原题:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.Example 1:Input: 1->2->3->3->4->4->5Output: 1-&g...原创 2019-08-25 11:35:42 · 125 阅读 · 0 评论 -
leetcode 5 Longest Palindromic Substring
leetcode 5. Longest Palindromic Substring原创 2016-01-29 01:02:56 · 346 阅读 · 0 评论 -
leetcode 11 Container With Most Water
leetcode 11 Container With Most Water原创 2016-01-28 01:17:14 · 353 阅读 · 0 评论 -
leetcode 9 Palindrome Number
leetcode 9 Palindrome Number原创 2016-01-18 21:57:52 · 319 阅读 · 0 评论 -
leetcode 303. Range Sum Query - Immutable
leetcode 303原创 2016-01-01 19:24:29 · 405 阅读 · 0 评论 -
leetcode 198 House Robber
leetcode 198 House Robber原创 2016-01-22 14:45:47 · 413 阅读 · 0 评论 -
leetcode 322. Coin Change
leetcode 322 Coin Change原创 2016-01-22 17:25:52 · 1355 阅读 · 0 评论 -
leetcode 62. Unique Paths
leetcode 62原创 2016-01-22 21:54:04 · 449 阅读 · 0 评论 -
leetcode 290 Word Pattern
leetcode 290 Word Pattern原创 2016-01-25 16:32:29 · 363 阅读 · 0 评论 -
leetcode 242 Valid Anagram
leetcode 242 Valid Anagram原创 2016-01-25 16:48:41 · 396 阅读 · 0 评论 -
leetcode 136. Single Number
leetcode 136 Single Number原创 2016-01-25 16:58:40 · 357 阅读 · 0 评论 -
leetcode 63. Unique Paths II
leetcode 63. Unique Paths II原创 2016-01-26 17:13:00 · 479 阅读 · 0 评论 -
leetcode 231. Power of Two
leetcode 231. Power of Two原创 2016-01-26 22:49:09 · 396 阅读 · 0 评论 -
leetcode 7 Reverse Integer
leetcode 7 Reverse Integer原创 2016-01-18 17:11:26 · 286 阅读 · 0 评论