随笔分类 -  leetcode

摘要:https://leetcode.com/problems/count-of-smaller-numbers-after-self/You are given an integer array nums and you have to return a new counts array. The c... 阅读全文
posted @ 2016-01-19 03:33 流白 阅读(212) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/sum-root-to-leaf-numbers/Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a n... 阅读全文
posted @ 2016-01-11 21:25 流白 阅读(178) 评论(0) 推荐(0)
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio... 阅读全文
posted @ 2016-01-11 20:37 流白 阅读(333) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/gas-station/题目:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have ... 阅读全文
posted @ 2016-01-05 17:56 流白 阅读(269) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/coin-change/You are given coins of different denominations and a total amount of money amount. Write a function to compu... 阅读全文
posted @ 2016-01-04 16:49 流白 阅读(515) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/binary-tree-maximum-path-sum/Given a binary tree, find the maximum path sum.For this problem, a path is defined as any s... 阅读全文
posted @ 2016-01-04 12:46 流白 阅读(193) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/search-for-a-range/Given a sorted array of integers, find the starting and ending position of a given target value.Your ... 阅读全文
posted @ 2016-01-03 19:34 流白 阅读(151) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in... 阅读全文
posted @ 2016-01-03 16:06 流白 阅读(153) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/edit-distance/Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each oper... 阅读全文
posted @ 2015-12-06 18:19 流白 阅读(144) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/game-of-life/According to theWikipedia's article: "TheGame of Life, also known simply asLife, is a cellular automaton de... 阅读全文
posted @ 2015-12-04 00:18 流白 阅读(291) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/decode-ways/A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2... 阅读全文
posted @ 2015-12-03 22:23 流白 阅读(265) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/text-justification/Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and... 阅读全文
posted @ 2015-12-03 17:20 流白 阅读(216) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/isomorphic-strings/Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters... 阅读全文
posted @ 2015-12-02 16:13 流白 阅读(211) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/h-index/Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compu... 阅读全文
posted @ 2015-12-02 14:40 流白 阅读(276) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/dungeon-game/The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The du... 阅读全文
posted @ 2015-12-02 10:56 流白 阅读(228) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/interleaving-string/Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2... 阅读全文
posted @ 2015-12-01 12:10 流白 阅读(158) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/palindrome-partitioning/Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all... 阅读全文
posted @ 2015-11-28 17:47 流白 阅读(253) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/ugly-number/Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose pr... 阅读全文
posted @ 2015-11-27 13:50 流白 阅读(236) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/word-break/Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence o... 阅读全文
posted @ 2015-11-26 21:27 流白 阅读(323) 评论(0) 推荐(0)
摘要:Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Theupdate(i, val)function modifiesnumsby updating the el... 阅读全文
posted @ 2015-11-20 11:13 流白 阅读(552) 评论(0) 推荐(0)