Leetcode
Mrfive555
这个作者很懒,什么都没留下…
展开
-
[leetcode]First Missing Positive
题目Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Exampl...原创 2018-09-08 19:23:27 · 136 阅读 · 0 评论 -
[leetcode] Create Maximum Number
Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits from the same ar...原创 2018-11-25 15:19:09 · 388 阅读 · 0 评论 -
[leetcode] Dungeon Game
题目The demons had captured the princess § 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 initially po...原创 2018-11-17 22:23:35 · 187 阅读 · 0 评论 -
[leetcode] Delete and Earn
题目Given an array nums of integers, you can perform operations on the array.In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every element equal to...原创 2018-11-10 17:19:17 · 211 阅读 · 0 评论 -
[leetcode] Super Egg Drop
题目You are given K eggs, and you have access to a building with N floors from 1 to N.Each egg is identical in function, and if an egg breaks, you cannot drop it again.You know that there exists a fl...原创 2018-11-04 20:38:17 · 302 阅读 · 0 评论 -
[leetcode] Longest Valid Parentheses
题目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-27 17:22:21 · 211 阅读 · 0 评论 -
[leetcode] Wildcard Matching
题目Given an input string (s) and a pattern §, implement wildcard pattern matching with support for ‘?’ and ‘*’.‘?’ Matches any single character.‘*’ Matches any sequence of characters (including the...原创 2018-10-21 21:40:44 · 169 阅读 · 0 评论 -
[leetcode] Redundant Connection II
题目In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, ex...原创 2018-09-29 22:33:45 · 126 阅读 · 0 评论 -
[leetcode] Merge Intervals
题目Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlap...原创 2018-10-06 21:23:55 · 227 阅读 · 0 评论 -
[leetcode] Similar String Groups
题目Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that it equals Y.For example, “tars” and “rats” are similar (swapping at positions 0 and 2), and “rats”...原创 2018-10-13 10:31:11 · 280 阅读 · 0 评论 -
[Leetcode] K-Similar Strings
题目Strings A and B are K-similar (for some non-negative integer K) if we can swap the positions of two letters in A exactly K times so that the resulting string equals B.Given two anagrams A and B, r...原创 2018-09-22 13:02:32 · 347 阅读 · 0 评论 -
[leetcode]Jump Game II
题目Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal i...原创 2018-09-13 00:39:41 · 212 阅读 · 0 评论 -
[leetcode] Word Ladder II
题目Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:Only one letter can be changed at a timeEa...原创 2018-12-05 10:52:50 · 219 阅读 · 0 评论