摘要:
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
摘要:
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
摘要:
Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight). Example 1: Example 2: Exa 阅读全文
摘要:
Reverse bits of a given 32 bits unsigned integer. Example 1: Example 2: Note: Note that in some languages such as Java, there is no unsigned integer t 阅读全文
摘要:
Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Note: Try to come up as many solutions as you 阅读全文
摘要:
Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Example 2: Note: The result may be very large, 阅读全文
摘要:
Given an integer n, return the number of trailing zeroes in n!. Example 1: Example 2: 看见没有,一行就能搞定??我感觉我像个弱智 例1 n=15。那么在15! 中 有3个5(来自其中的5, 10, 15), 所以计 阅读全文
摘要:
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 阅读全文
摘要:
A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return 阅读全文