# Nicksxs's Blog
learn from zero,技术博客，Nicksxs，史学森

0%

## add-two-number

Posted on 2015-04-14 Edited on 2020-01-12 In leetcode Views: Disqus:

### problem

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.

Input:`(2 -> 4 -> 3) + (5 -> 6 -> 4)`
Output: `7 -> 0 -> 8`

分析（不用英文装逼了）
这个代码是抄来的，链接原作是这位大大。

Read more »

## Reverse Integer

Posted on 2015-03-13 Edited on 2020-01-12 In leetcode Views: Disqus:

### Reverse Integer

#### Reverse digits of an integer.

Example1: x = 123, return 321
Example2: x = -123, return -321

Read more »

## Reverse Bits

Posted on 2015-03-11 Edited on 2020-01-12 In leetcode Views: Disqus:

### Reverse Bits

#### Reverse bits of a given 32 bits unsigned integer.

For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110000010100101000000).

Read more »

## Number of 1 Bits

Posted on 2015-03-11 Edited on 2020-01-12 In leetcode Views: Disqus:

### Number of 1 Bits

#### 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-bit integer ‘11’ has binary representation `00000000000000000000000000001011`, so the function should return 3.

Read more »

## pcre-intro-and-a-simple-package

Posted on 2015-01-16 Edited on 2020-01-12 In C++ Views: Disqus:

### Pcre

> Perl Compatible Regular Expressions (PCRE) is a regular
> expression C library inspired by the regular expression
> capabilities in the Perl programming language, written
> by Philip Hazel, starting in summer 1997.

因为最近工作内容的一部分需要做字符串的识别处理，所以就顺便用上了之前在PHP中用过的正则，在C/C++中本身不包含正则库，这里使用的pcre，对MFC开发，在这里提供了静态链接库，在引入lib跟.h文件后即可使用。

Read more »