摘要: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex 阅读全文
posted @ 2017-04-01 18:44 一片叶子啊 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1. The length 阅读全文
posted @ 2017-04-01 18:26 一片叶子啊 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 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 ston 阅读全文
posted @ 2017-04-01 17:16 一片叶子啊 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 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/ve 阅读全文
posted @ 2017-04-01 16:54 一片叶子啊 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 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' 阅读全文
posted @ 2017-04-01 16:23 一片叶子啊 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 分析: 阅读全文
posted @ 2017-04-01 15:49 一片叶子啊 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 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 numbe 阅读全文
posted @ 2017-04-01 00:00 一片叶子啊 阅读(129) 评论(0) 推荐(0) 编辑