- 博客(16)
- 收藏
- 关注
原创 [Leetcode] 485. Max Consecutive Ones
Description: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 are...
2018-07-30 15:17:02
215
原创 [Leetcode] 226. Invert Binary Tree
Description:Invert a binary tree.Example:Input: 4 / \ 2 7 / \ / \1 3 6 9Output: 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired ...
2018-07-30 14:35:46
141
原创 [Leetcode] 824. Goat Latin
Description:A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only.We would like to convert the sentence to "Goat Latin" (a made-u...
2018-07-27 15:42:27
228
原创 [Leetcode] 292. Nim Game
Description:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last sto...
2018-07-27 14:07:26
208
原创 [Leetcode] 762. Prime Number of Set Bits in Binary Representation
Description:Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation.(Recall that the number of set bi...
2018-07-27 13:40:16
222
原创 [Leetcode] 521. Longest Uncommon Subsequence I
Description:Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defined as the longest subsequence of on...
2018-07-26 16:09:20
198
原创 [Leetcode] 104. Maximum Depth of Binary Tree
Description:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node w...
2018-07-26 14:40:35
156
原创 [Leetcode] 693. Binary Number with Alternating Bits
Description:Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.Example 1:Input: 5Output: TrueExplanation:The bina...
2018-07-26 13:58:41
193
原创 [Leetcode] 637. Average of Levels in Binary Tree
Description:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5,...
2018-07-25 16:32:51
150
原创 [Leetcode] 136. Single Number
DescriptionGiven a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement ...
2018-07-25 14:59:00
127
原创 [Leetcode] 496. Next Greater Element I
Description:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places...
2018-07-02 13:23:38
176
原创 [Leetcode] 412. Fizz Buzz
Description:Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output ...
2018-06-29 09:58:02
246
原创 [Leetcode] 575. Distribute Candies
Description:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to dist...
2018-06-28 11:37:48
171
原创 [Leetcode] 463. Island Perimeter
Description:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is...
2018-06-27 10:31:37
134
原创 [Leetcode] 811.Subdomain Visit Count
Description:A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com", and at the lowest level, "discuss.l...
2018-06-25 14:22:20
201
原创 [Leetcode] 476. Number Complement
Description: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 within the rang...
2018-06-25 14:21:36
227
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人