- 博客(9)
- 收藏
- 关注
原创 365. Water and Jug Problem
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is possible to measure exactly z litres using these two ju
2016-07-31 11:42:17 233
原创 324. Wiggle Sort II
Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....Example:(1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6]. (2) Given nums = [1,
2016-07-31 10:41:55 185
原创 71. Simplify Path
Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"Corner Cases: Did you consider the case where path = “/../”? In th
2016-07-30 16:49:17 152
原创 375. Guess Number Higher or Lower II
We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number I picked is highe
2016-07-26 18:45:13 176
原创 368. Largest Divisible Subset
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or Sj % Si = 0.If there are multiple solutions, return
2016-07-26 17:57:15 171
原创 331. Verify Preorder Serialization of a Binary Tree
One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node’s value. If it is a null node, we record using a sentinel value such as #. _9
2016-07-23 10:43:08 197
原创 372. Super Pow
Your task is to calculate a^b mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.Example1:a = 2b = [3]Result: 8Example2:a = 2b = [1,0]R
2016-07-23 09:36:49 291
原创 376. Wiggle Subsequence
A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either posi
2016-07-22 12:31:14 270
原创 371 Sum of Two Integers
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return 3.转自 https://discuss.leetcode.com/topic/49771/java-simple-easy-un
2016-07-20 17:15:51 272
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人