摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-03-15 19:28 BestWangJie 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return... 阅读全文
posted @ 2015-03-14 22:20 BestWangJie 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目就是:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-... 阅读全文
posted @ 2015-03-14 21:33 BestWangJie 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:... 阅读全文
posted @ 2015-03-03 21:18 BestWangJie 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 问题是这样子的:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see... 阅读全文
posted @ 2015-01-30 11:37 BestWangJie 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1.不要浮躁 2.制定计划 3.执行力 阅读全文
posted @ 2015-01-09 16:58 BestWangJie 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 ... 阅读全文
posted @ 2014-12-29 14:51 BestWangJie 阅读(131) 评论(0) 推荐(0) 编辑
摘要: problem:Given an input string, reverse the string word by word.For example:Given s = "the sky is blue",return "blue is sky the".问题分析:如何准确的找到每一个需要清除的空格... 阅读全文
posted @ 2014-12-23 19:40 BestWangJie 阅读(164) 评论(0) 推荐(0) 编辑
摘要: problem:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.problem analysis... 阅读全文
posted @ 2014-12-23 19:13 BestWangJie 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 今天做了一道MinStack的题,深深的感到自己C++还完全没有学好!!!#include #include using std::stack;class MinStack {public: stack st; stack stm; void push(int x) { ... 阅读全文
posted @ 2014-12-13 16:07 BestWangJie 阅读(126) 评论(0) 推荐(0) 编辑