Leetcode
文章平均质量分 69
ApRiLLLLLLLLLLLL
这个作者很懒,什么都没留下…
展开
-
[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 · 173 阅读 · 1 评论 -
[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 · 157 阅读 · 0 评论 -
[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 · 174 阅读 · 0 评论 -
[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 · 185 阅读 · 0 评论 -
[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 · 114 阅读 · 0 评论 -
[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 · 167 阅读 · 0 评论 -
[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 · 119 阅读 · 0 评论 -
[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 · 156 阅读 · 0 评论 -
[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 · 122 阅读 · 0 评论 -
[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 · 94 阅读 · 0 评论 -
[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 · 157 阅读 · 0 评论 -
[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 · 147 阅读 · 0 评论 -
[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 · 149 阅读 · 0 评论 -
[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 · 104 阅读 · 0 评论 -
[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 · 193 阅读 · 0 评论 -
[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 · 194 阅读 · 0 评论