上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 76 下一页
摘要: 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 阅读全文
posted @ 2019-04-16 02:32 Schwifty 阅读(90) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-04-12 06:01 Schwifty 阅读(128) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-04-12 04:10 Schwifty 阅读(124) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-04-12 04:04 Schwifty 阅读(123) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-04-12 02:05 Schwifty 阅读(124) 评论(0) 推荐(0)
摘要: 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, 阅读全文
posted @ 2019-04-11 05:17 Schwifty 阅读(212) 评论(0) 推荐(0)
摘要: 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), 所以计 阅读全文
posted @ 2019-04-04 11:26 Schwifty 阅读(108) 评论(0) 推荐(0)
摘要: Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: 左右 上下 右左 下上 阅读全文
posted @ 2019-04-03 13:16 Schwifty 阅读(129) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-03-29 03:35 Schwifty 阅读(209) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2019-03-28 04:17 Schwifty 阅读(143) 评论(0) 推荐(0)
上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 76 下一页