- 博客(21)
- 资源 (4)
- 收藏
- 关注
原创 leetcode oj java 116. Populating Next Right Pointers in Each Node
一、问题描述:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next
2017-01-21 11:03:11 288
原创 leetcode oj java 485. Max Consecutive Ones
一、问题描述:Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits a
2017-01-19 20:52:29 517
原创 leetcode oj java 230. Kth Smallest Element in a BST
一、问题描述:Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.二、解决思路:
2017-01-17 22:41:30 297
原创 leetcode oj java 143. Reorder List
一、问题描述: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 without altering the nodes' values.For example,Given {1,2,3,4}, r
2017-01-15 15:25:25 340
原创 leetcode oj java 69. Sqrt(x)
一、问题描述:Implement int sqrt(int x).Compute and return the square root of x.二、解决思路看到代码中返回类型是Int, 非常开心! 二分法~~ 但是需要注意边界值 MAX_INT. 而且MAX_INT的平方我们已知是46340, 我们在初始化的时候end =(x+1)/2,如果end >
2017-01-14 22:33:55 424
原创 leetcode oj java 49. Group Anagrams
一、问题描述:Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]
2017-01-14 17:27:48 388
原创 leetcode oj java 215. Kth Largest Element in an Array
一、问题描述:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k =
2017-01-14 16:10:18 261
原创 leetcode oj java 199. Binary Tree Right Side View
一、问题描述:Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary
2017-01-14 15:40:05 314
原创 leetcode oj java 64. Minimum Path Sum
一、问题描述:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either dow
2017-01-14 13:05:09 240
原创 leetcode oj java 386. Lexicographical Numbers
一、问题描述:Given an integer n, return 1 - n in 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.
2017-01-14 10:26:40 296
原创 leetcode oj java 309. Best Time to Buy and Sell Stock with Cooldown
一、问题描述:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you lik
2017-01-13 22:44:59 551
原创 leetcode oj java 337. House Robber 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.
2017-01-13 22:05:16 280
原创 leetcode oj java 476. Number Complement
一、问题描述:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit with
2017-01-11 21:58:25 812
原创 leetcode oj java 481. Magical String
一、问题描述:A magical string S consists of only '1' and '2' and obeys the following rules:The string S is magical because concatenating the number of contiguous occurrences of characters '1' and
2017-01-11 21:38:30 1062
原创 leetcode oj java 475. Heaters
一、问题描述:Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now, you are given positions of houses and heaters on
2017-01-08 23:06:46 363
原创 leetcode oj java 260. Single Number III
一、问题描述:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For examp
2017-01-04 11:34:22 400
原创 leetcode oj java 315. Count of Smaller Numbers After Self
一、问题描述You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i]
2017-01-03 23:03:58 485
原创 leetcode oj java 313. Super Ugly Number
一、问题描述Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1,
2017-01-01 22:44:32 303
原创 leetcode oj java 264. Ugly Number II
一、问题描述:Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence
2017-01-01 22:31:52 283
原创 leetcode oj java 179. Largest Number
一、问题描述:Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The res
2017-01-01 21:38:20 324
原创 leetcode oj java 152. Maximum Product Subarray
一、问题描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has
2017-01-01 10:46:00 281
神经网络LSTM 时间预测
2017-08-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人