![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
whhhhhhh24
这个作者很懒,什么都没留下…
展开
-
【169】Majority Element
题目: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority e原创 2017-03-05 14:51:00 · 163 阅读 · 0 评论 -
【394】Decode String
题目: Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k原创 2017-06-06 23:23:52 · 144 阅读 · 0 评论 -
【268】 Missing Number
题目: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Given nums = [0, 1, 3] return 2. Note: Your algorithm sh原创 2017-05-18 15:51:12 · 251 阅读 · 0 评论 -
【547】Friend Circles
题目: There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct friend of C,原创 2017-05-28 18:52:20 · 208 阅读 · 0 评论 -
【442】Find All Duplicates in an Array
题目: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could you do it witho原创 2017-05-27 21:50:45 · 138 阅读 · 0 评论 -
【486】 Predict the Winner
题目: Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player pi原创 2017-05-08 01:01:04 · 142 阅读 · 0 评论 -
【70】Climbing Stairs
问题: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a原创 2017-04-23 18:22:40 · 107 阅读 · 0 评论 -
【516】 Longest Palindromic Subsequence
题目: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1: Input: "bbbab" Output: 4 One possible longest p原创 2017-05-04 00:15:09 · 178 阅读 · 0 评论 -
【357】Count Numbers with Unique Digits
题目: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x Example: Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x 思路:原创 2017-04-15 21:31:53 · 193 阅读 · 0 评论 -
【338】Counting Bits
题目: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array. Example: For nu原创 2017-04-05 22:47:24 · 153 阅读 · 0 评论 -
【406】 Queue Reconstruction by Height
题目: Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front o原创 2017-03-26 22:21:18 · 128 阅读 · 0 评论 -
【100】Same Tree && 【104】Maximum Depth of Binary Tree
题目: 【100】Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have th原创 2017-03-12 22:21:19 · 156 阅读 · 0 评论 -
【513】 Find Bottom Left Tree Value
题目: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2 3 / / \ 4 5 6 / 7 Output: 7原创 2017-03-19 21:00:56 · 140 阅读 · 0 评论 -
【55】Jump Game
题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determ原创 2017-06-11 15:06:14 · 109 阅读 · 0 评论