自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 NO.9_476. Number Complement

476. Number Complement Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guara

2017-01-15 22:00:06 530

原创 NO.8_485. Max Consecutive Ones

485. Max Consecutive Ones Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the

2017-01-15 20:22:14 160

原创 NO.7_136. Single Number

136. 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 impl

2017-01-14 22:00:29 217

原创 NO.6_292. Nim Game

292. 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 las

2017-01-14 20:59:12 222

原创 NO.5_448. Find All Numbers Disappeared in an Array

448. Find All Numbers Disappeared in an Array Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of

2017-01-14 20:43:16 154

原创 NO.4_463. Island Perimeter

463. Island Perimeter //参考解 //总数减错误计算的 int islandPerimeter(vector>& grid) { int count=0, repeat=0; for(int i=0;i<grid.size();i++) { for(int j=0; j<grid[i].size

2017-01-11 16:41:59 161

原创 NO.3_344. Reverse String

344. Reverse String 解法1(不好): class Solution { public: string reverseString(string s) { string a; const char *t = s.c_str();//string转char* int length=s.length();

2017-01-10 21:33:14 144

原创 NO.2_412. Fizz Buzz

412. Fizz Buzz //解1 class Solution { public: vector fizzBuzz(int n) { vector a; std::stringstream ss; std::string str_out; for(int i=1; i<=n; ++i) {

2017-01-10 20:29:44 218

原创 NO.1_461. Hamming Distance

class Solution { public:     int hammingDistance(int x, int y)      {         int p=x^y;         int a=0;        while(p)//找出所有的1         {             a=a+(p&1);             p=p>>1;

2017-01-09 10:41:39 336

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除