LeetCode题解
CFH_爆裂码手
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode题解–4. Median of Two Sorted Arrays
LeetCode题解–4. Median of Two Sorted Arrays原创 2017-02-24 01:06:10 · 386 阅读 · 0 评论 -
LeetCode题解–215. Kth Largest Element in an Array
链接LeetCode题目:https://leetcode.com/problems/kth-largest-element-in-an-array/难度:Medium题目 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order,原创 2017-06-21 14:54:43 · 306 阅读 · 0 评论 -
LeetCode题解–226. Invert Binary Tree
链接LeetCode题目:https://leetcode.com/problems/invert-binary-tree/ 难度:Easy题目 Invert a binary tree.分析这题比较简单,利用分治的想法就能翻转二叉树。代码class Solution {public: TreeNode* invertTree(TreeNode* root) { i原创 2017-06-28 19:43:13 · 266 阅读 · 0 评论 -
LeetCode题解–207. Course Schedule
链接LeetCode题目:https://leetcode.com/problems/course-schedule/难度:Medium题目 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example t原创 2017-06-07 20:32:17 · 324 阅读 · 0 评论 -
LeetCode题解–134. Gas Station
链接LeetCode题目:https://leetcode.com/problems/gas-station/难度:Medium题目 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimite原创 2017-06-01 20:40:24 · 418 阅读 · 0 评论 -
LeetCode题解–130. Surrounded Regions
链接LeetCode题目:https://leetcode.com/problems/surrounded-regions/难度:Medium题目 Given a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’. A region is captured by fli原创 2017-04-27 15:19:56 · 340 阅读 · 0 评论 -
LeetCode题解–200. Number of Islands
链接LeetCode题目:https://leetcode.com/problems/number-of-islands/难度:Medium题目 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 form原创 2017-05-18 14:42:08 · 429 阅读 · 0 评论 -
LeetCode题解–143. Reorder List
链接LeetCode题目:https://leetcode.com/problems/minimum-window-substring/难度:Hard题目 Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place wit原创 2017-05-24 13:27:45 · 310 阅读 · 0 评论 -
LeetCode题解–135. Candy
链接LeetCode题目:https://leetcode.com/problems/candy/难度:Hard题目 There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the原创 2017-05-04 16:23:15 · 449 阅读 · 0 评论 -
LeetCode题解–131. Palindrome Partitioning
链接LeetCode题目:https://leetcode.com/problems/palindrome-partitioning/难度:Medium题目 Given a string s, partition s such that every substring of the partition is a palindrome.题目大意是给定一个字符串,返回所有子串是回文串的划分情况。比原创 2017-05-11 13:37:16 · 247 阅读 · 0 评论 -
LeetCode题解–72. Edit Distance
链接LeetCode题目:https://leetcode.com/problems/edit-distance/难度:Hard题目 Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as原创 2017-04-06 14:40:15 · 338 阅读 · 0 评论 -
LeetCode题解–137. Word Break
链接LeetCode题目:https://leetcode.com/problems/word-break/难度:Medium题目 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 spa原创 2017-04-19 13:55:18 · 320 阅读 · 0 评论 -
LeetCode题解–137. Single Number II
链接LeetCode题目:https://leetcode.com/problems/single-number-ii/难度:Medium题目 Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.原创 2017-04-13 15:32:13 · 382 阅读 · 0 评论 -
LeetCode题解–76. Minimum Window Substring
链接LeetCode题目:https://leetcode.com/problems/minimum-window-substring/难度:Hard题目 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(原创 2017-03-23 21:07:13 · 304 阅读 · 0 评论 -
LeetCode题解–120. Triangle
链接LeetCode题目:https://leetcode.com/problems/triangle/难度:Medium题目 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For exa原创 2017-03-14 15:24:14 · 255 阅读 · 0 评论 -
LeetCode题解–55. Jump Game
链接LeetCode题目:https://leetcode.com/problems/jump-game/难度:Medium题目 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).原创 2017-03-30 14:58:01 · 263 阅读 · 0 评论 -
LeetCode题解–133. Clone Graph
链接LeetCode题目:https://leetcode.com/problems/clone-graph/难度:Medium题目 Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.该无向图结点包含的信息有整数标签和一个保存所有邻接结点的vector。考原创 2017-03-09 18:56:40 · 275 阅读 · 0 评论 -
LeetCode题解–46. Permutations
链接LeetCode题目:https://leetcode.com/problems/permutations难度:Medium题目 Given a collection of distinct numbers, return all possible permutations.简单来说,此题的目的是计算n个相异数的所有可能的排列情况。分析这题不算很难,为了得到n个数字的排列,可以先把第1个数原创 2017-03-03 01:06:27 · 301 阅读 · 0 评论 -
LeetCode题解–260. Single Number III
链接LeetCode题目:https://leetcode.com/problems/single-number-iii/难度:Medium题目 Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice原创 2017-06-15 14:45:15 · 308 阅读 · 0 评论
分享