- 博客(7)
- 收藏
- 关注
原创 LeetCode刷题(Third Maximum Number )
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3, 2,
2017-03-10 11:28:56 285
原创 Leetcode刷题(Single Number)
问题描述:Given 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 without using
2017-01-23 21:18:10 160
原创 Leetcode刷题(Nim Game)
问题描述: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 stones. The one who removes the last stone will
2017-01-23 21:05:18 161
原创 Leetcode刷题(Reverse String)
问题描述:Write a function that takes a string as input and returns the string reversedExample:Given s = "hello", return "olleh".此题很简单,使用java StringBuffer下reverse命令即可最简单的方法:public class S
2017-01-23 16:55:45 179
原创 Leetcode刷题(Max Consecutive Ones)
问题描述:Given a binary array, find the maximum number of consecutive 1s in this array.即 找到二进制数组中最多的连续1的个数。Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits a
2017-01-23 15:23:50 187
原创 LeetCode刷题(FizzBuzz)
问题描述: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 number and for the multiples of five output “
2017-01-23 13:42:18 477
原创 LeetCode刷题(Two Sum)
功能:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example:Given nums = [2,
2017-01-21 13:55:27 198
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人