自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(43)
  • 收藏
  • 关注

转载 (Java) LeetCode 116. Populating Next Right Pointers in Each Node —— 填充同一层的兄弟节点...

Given a binary treestruct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next;}Populate each next pointer to point to its next right node. If there is no n...

2018-08-29 21:02:00 160

转载 (Java) LeetCode 740. Delete and Earn —— 删除与获得点数

Given an arraynumsof integers, you can perform operations on the array.In each operation, you pick anynums[i]and delete it to earnnums[i]points. After, you must deleteeveryelement equal...

2018-08-29 11:43:00 177

转载 (Java) LeetCode 79. Word Search —— 单词搜索

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertica...

2018-08-29 10:41:00 158

转载 (Java) LeetCode 412. Fizz Buzz —— Fizz Buzz

Write a program that outputs the string representation of numbers from 1 ton.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz...

2018-08-10 10:23:00 187

转载 (Java) LeetCode 540. Single Element in a Sorted Array —— 有序数组中的单一元素

Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once.Example 1:Input...

2018-08-09 15:02:00 155

转载 (Java) LeetCode 273. Integer to English Words —— 整数转换英文表示

Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231- 1.For example,123 -> "One Hundred Twenty Three"12345 -> "Twelve T...

2018-08-09 12:40:00 106

转载 (Java) LeetCode 462. Minimum Moves to Equal Array Elements II —— 最少移动次数使数组元素相等 II...

Given anon-emptyinteger array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected elemen...

2018-08-07 21:54:00 137

转载 (Java) LeetCode 453. Minimum Moves to Equal Array Elements —— 最小移动次数使数组元素相等...

Given anon-emptyinteger array of sizen, find the minimum number of moves required to make all array elements equal, where a move is incrementingn- 1 elements by 1.Example:Input:[1,2,...

2018-08-07 21:34:00 76

转载 (Java) LeetCode 470. Implement Rand10() Using Rand7() —— 用 Rand7() 实现 Rand10()

Given a functionrand7which generates a uniform random integer in the range 1 to 7, write a functionrand10which generates a uniform random integer in the range 1 to 10.Do NOT use system'sMa...

2018-08-07 17:48:00 197

转载 (Java) LeetCode 135. Candy —— 分发糖果

There areNchildren 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...

2018-08-06 22:11:00 102

转载 (Java) LeetCode 44. Wildcard Matching —— 通配符匹配

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (includ...

2018-07-14 20:31:00 132

转载 (Java) LeetCode 30. Substring with Concatenation of All Words —— 与所有单词相关联的字串...

You are given a string,s, and a list of words,words, that are all of the same length. Find all starting indices of substring(s) insthat is a concatenation of each word inwordsexactly once an...

2018-07-13 23:28:00 94

转载 (Java) LeetCode 515. Find Largest Value in Each Tree Row —— 在每个树行中找最大值

You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]...

2018-07-13 08:59:00 242

转载 (Java) LeetCode 433. Minimum Genetic Mutation —— 最小基因变化

A gene string can be represented by an 8-character long string, with choices from"A","C","G","T".Suppose we need to investigate about a mutation (mutation from "start" to "end"), where ONE ...

2018-07-13 08:34:00 286

转载 (Java) LeetCode 413. Arithmetic Slices —— 等差数列划分

A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For example, these are arithmetic sequ...

2018-07-12 18:03:00 156

转载 (Java) LeetCode 289. Game of Life —— 生命游戏

According to theWikipedia's article: "TheGame of Life, also known simply asLife, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."Given aboardwithm...

2018-07-12 17:31:00 215

转载 (Java) LeetCode 337. House Robber III —— 打家劫舍 III

The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a...

2018-07-09 10:26:00 138

转载 (Java) LeetCode 213. House Robber II —— 打家劫舍 II

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place arearranged in a circle.That means the first hous...

2018-07-09 10:03:00 131

转载 (Java) LeetCode 198. House Robber —— 打家劫舍

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent ...

2018-07-09 09:56:00 98

转载 (Java) LeetCode 152. Maximum Product Subarray —— 乘积最大子序列

Given an integer arraynums, find the contiguous subarray within an array (containing at least one number) which has the largest product.Example 1:Input: [2,3,-2,4]Output: 6Explanation:...

2018-07-08 21:11:00 115

转载 (Java) LeetCode 386. Lexicographical Numbers —— 字典序排数

Given an integern, return 1 -nin lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorithm to use less time and space. The input s...

2018-07-08 20:13:00 180

转载 (Java) LeetCode 24. Swap Nodes in Pairs —— 两两交换链表中的节点

Given alinked list, swap every two adjacent nodes and return its head.Example:Given 1->2->3->4, you should return the list as 2->1->4->3.Note:Your algorithm shoul...

2018-07-08 10:50:00 116

转载 (Java) LeetCode 206. Reverse Linked List —— 反转链表

Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or...

2018-07-08 10:49:00 71

转载 (Java) LeetCode 25. Reverse Nodes in k-Group —— k个一组翻转链表

Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.kis a positive integer and is less than or equal to the length of the linked list. If the numbe...

2018-07-08 10:47:00 110

转载 (Java) LeetCode 139. Word Break —— 单词拆分

Given anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.Note:...

2018-07-03 22:12:00 131

转载 (Java) LeetCode 416. Partition Equal Subset Sum —— 分割等和子集

Given anon-emptyarray containingonly positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note:Each of the arra...

2018-07-03 11:45:00 242

转载 (Java) LeetCode 40. Combination Sum II —— 组合总和 II

Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations incandidateswhere the candidate numbers sums totarget.Each number incandidate...

2018-07-03 10:32:00 88

转载 (Java) LeetCode 39. Combination Sum —— 组合总和

Given asetof candidate numbers (candidates)(without duplicates)and a target number (target), find all unique combinations incandidateswhere the candidate numbers sums totarget.Thesame...

2018-07-03 10:12:00 100

转载 (Java) LeetCode 275. H-Index II —— H指数 II

Given an array of citationssortedin ascending order(each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to thedefinition...

2018-07-02 17:46:00 260

转载 (Java) LeetCode 82. Remove Duplicates from Sorted List II —— 删除排序链表中的重复元素 II...

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.Example 1:Input: 1->2->3->3->4->4->5Output...

2018-07-02 16:47:00 63

转载 (Java) LeetCode 83. Remove Duplicates from Sorted List —— 删除排序链表中的重复元素

Given a sorted linked list, delete all duplicates such that each element appear onlyonce.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->3->3...

2018-07-02 13:17:00 95

转载 (Java) LeetCode 377. Combination Sum IV —— 组合总和 Ⅳ

Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.Example:nums = [1, 2, 3]target = 4...

2018-07-02 01:01:00 128

转载 (Java) LeetCode 274. H-Index —— H指数

Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to thedefinition of h-index on Wikipedia: ...

2018-07-01 23:39:00 132

转载 (Java) LeetCode 127. Word Ladder —— 单词接龙

Given two words (beginWordandendWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWordtoendWord, such that:Only one letter can be changed ...

2018-07-01 10:25:00 122

转载 (Java) LeetCode 322. Coin Change —— 零钱兑换

You are given coins of different denominations and a total amount of moneyamount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of m...

2018-07-01 00:27:00 102

转载 (Java) LeetCode 56. Merge Intervalse —— 合并区间

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] ...

2018-06-30 23:40:00 107

转载 (Java) LeetCode 334. Increasing Triplet Subsequence —— 递增的三元子序列

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should:Return true if there exists i, j, k such that arr[i] &...

2018-06-29 23:18:00 120

转载 (Java) LeetCode 91. Decode Ways —— 解码方法

A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given anon-emptystring containing only digits, d...

2018-06-29 22:54:00 99

转载 (Java) LeetCode 392. Is Subsequence —— 判断子序列

Given a stringsand a stringt, check ifsis subsequence oft.You may assume that there is only lower case English letters in bothsandt.tis potentially a very long (length ~= 500,000) st...

2018-06-29 14:37:00 102

转载 LeetCode 思路及解答

终于作为转专业小白的我也开始刷题啦!希望能通过记录分享的形式加深解题思路的理解和记忆。也希望大神们能够指点一二。列表中的题目名称都是链接,难度和标签也都是也都是链接,方便归类搜索。NumberProblem NameDifficultyTagsProgramming Languages24Swap Nodes in Pairs...

2018-06-29 12:23:00 123

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除