leetCode刷题
那个松鼠很眼熟
这个作者很懒,什么都没留下…
展开
-
【LeetCode 001】Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the sam...原创 2018-10-02 07:31:19 · 112 阅读 · 0 评论 -
【LeetCode 002】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 return...原创 2018-10-02 11:18:18 · 122 阅读 · 0 评论 -
【LeetCode 321】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...原创 2018-10-04 06:46:11 · 417 阅读 · 1 评论 -
【LeetCode 174】Dungeon Game
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 initially p...原创 2018-10-04 08:18:43 · 176 阅读 · 0 评论 -
【LeetCode 745】Prefix and Suffix Search
Given many words, words[i] has weight i.Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will return the word with given prefix and suffix with ...原创 2018-10-04 10:18:43 · 359 阅读 · 0 评论 -
【LeetCode 135】Candy
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 following requirements:Each child must have at least one can...原创 2018-10-04 17:11:59 · 181 阅读 · 0 评论 -
【LeetCode41】First Missing Positive
Given an unsorted integer array, find the smallest missing positive integer.Your algorithm should run in O(n) time and uses constant extra space.题意:求一个数组中最小的缺失正数。要求O(n)的时间复杂度和O(1)的空间复杂度。Example ...原创 2018-10-04 18:21:27 · 135 阅读 · 0 评论