![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode刷题笔记
文章平均质量分 82
jollysoul
千里之行,始于足下。
展开
-
Leetcode——97. Interleaving String
问题描述:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbba原创 2017-05-08 11:45:30 · 321 阅读 · 0 评论 -
leetocd---207. Course Schedule
There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as原创 2017-09-06 15:38:50 · 227 阅读 · 0 评论 -
Leetcode-236. Lowest Common Ancestor of a Binary Tree 最小公共祖先
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two node原创 2017-09-05 16:44:49 · 278 阅读 · 0 评论 -
Leetcode—200.Number of Islands
问题描述:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. Y原创 2017-07-25 15:57:06 · 254 阅读 · 0 评论 -
Leetcode—174. Dungeon Game 倒序DP
问题描述:The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was原创 2017-07-25 21:05:53 · 380 阅读 · 0 评论 -
Leetcode—221.Maximal Square 最大正方形
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 1原创 2017-07-25 01:26:34 · 1816 阅读 · 5 评论 -
Leetcode—139. Word Break
问题描述:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary wo原创 2017-07-23 09:45:22 · 223 阅读 · 0 评论 -
Leetcode—154. Find Minimum in Rotated Sorted Array II
问题描述:Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Suppose an array sorted in ascending o原创 2017-07-22 08:54:23 · 193 阅读 · 0 评论 -
leetcode—153. Find Minimum in Rotated Sorted Array 在翻转数组寻找最小值
问题描述:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may a原创 2017-07-22 08:43:02 · 251 阅读 · 0 评论 -
Leetcode—152. Maximum Product Subarray 最小乘积子串
问题描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has t原创 2017-07-21 20:50:35 · 314 阅读 · 0 评论 -
Leetcode——639.Decode Ways II
题目描述:A message containing letters from A-Z is being encoded to numbers using the following mapping way:'A' -> 1'B' -> 2...'Z' -> 26Beyond that, now the encoded string can also contai原创 2017-07-11 18:58:00 · 1063 阅读 · 0 评论 -
Leetcode——134 Gas Station
问题描述 :There are N gas stations along a circular route, where the amount of gas at stationi is gas[i].You have a car with an unlimited gas tank and it costs cost[i]of gas to travel from stati原创 2017-04-27 19:08:07 · 294 阅读 · 0 评论 -
Leetcode——208. Implement Trie (Prefix Tree) C++语言实现Tire
//slower than recursive versionclass Trie {private: static constexpr int R = 26; struct Node { bool is_word = false; Node *next = nullptr; };public: //~Trie(); How t原创 2017-09-06 16:25:10 · 498 阅读 · 0 评论