![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
zdxdxd
永远保持对新事物的向往。
展开
-
461. Hamming Distance
Problem StatementThe Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note: 0原创 2017-09-29 21:26:41 · 227 阅读 · 0 评论 -
104. Maximum Depth of Binary Tree
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原创 2017-12-11 16:47:08 · 492 阅读 · 0 评论 -
485. Max Consecutive Ones
Problem StatementGiven 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原创 2017-12-11 16:45:35 · 465 阅读 · 0 评论 -
136. Single Number
Problem StatementGiven an 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 it witho原创 2017-12-11 16:40:28 · 427 阅读 · 0 评论 -
292. Nim Game
Problem StatementYou 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 s原创 2017-12-11 16:32:22 · 443 阅读 · 0 评论 -
521. Longest Uncommon Subsequence I
Problem StatementGiven 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原创 2017-12-11 16:29:34 · 441 阅读 · 0 评论 -
496. Next Greater Element I
Problem StatementYou 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 pl原创 2017-12-11 16:25:00 · 430 阅读 · 0 评论 -
412. Fizz Buzz
Problem StatementWrite 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 out原创 2017-12-11 16:14:52 · 221 阅读 · 0 评论 -
575. Distribute Candies
Problem StatementGiven 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原创 2017-11-02 20:37:57 · 221 阅读 · 0 评论 -
344. Reverse String
Problem StatementWrite a function that takes a string as input and returns the string reversed.Example 1:Given s = "hello", return "olleh".Thinking反转单词。Solutionclass Solution { public String rever原创 2017-11-02 20:48:32 · 257 阅读 · 0 评论 -
557. Reverse Words in a String III
Problem StatementGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "Let's take LeetCod原创 2017-11-02 20:46:03 · 263 阅读 · 0 评论 -
682. Baseball Game
Problem StatementYou’re now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round’s score): Directly represents the number of point原创 2017-10-10 16:26:42 · 245 阅读 · 0 评论 -
500. Keyboard Row
Problem StatementGiven a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below.Example 1:Input: ["Hello", "Alaska", "D原创 2017-09-29 21:41:53 · 286 阅读 · 0 评论 -
476. Number Complement
Problem StatementGiven a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note: 1.The given integer is guaranteed to fit within原创 2017-09-29 21:37:54 · 236 阅读 · 0 评论 -
617. Merge Two Binary Trees
Problem StatementGiven two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a n原创 2017-09-29 21:34:16 · 215 阅读 · 0 评论 -
657. Judge Route Circle
Problem StatementInitially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.The move sequence is原创 2017-09-29 21:31:05 · 340 阅读 · 0 评论 -
226. Invert Binary Tree
Invert a binary tree.原创 2017-12-11 16:49:39 · 442 阅读 · 0 评论