ZMR小站

很高兴遇见你~


  • 首页

  • 标签

  • 分类

  • 归档

p441

发表于 2016-11-27 | 分类于 blog

LeetCode p441 Arranging Coins 题解

1.题目:

You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.

Given n, find the total number of full staircase rows that can be formed.

n is a non-negative integer and fits within the range of a 32-bit signed integer.

Example 1:

n = 5

The coins can form the following rows:
¤
¤ ¤
¤ ¤

Because the 3rd row is incomplete, we return 2.

Example 2:

n = 8

The coins can form the following rows:
¤
¤ ¤
¤ ¤ ¤
¤ ¤

Because the 4th row is incomplete, we return 3.

阅读全文 »

SqlLib学习记录

发表于 2016-11-26 | 分类于 bolg

##SqlLib学习记录

###预备:环境搭建与资源
https://github.com/Audi-1/sqli-labs
http://www.cnblogs.com/sylarinfo/p/3456445.html

开始尝试在kali上面搭建,完成之后打开本地代码出现 403 forbidden
调整配置无果可能还要折腾防火墙 参考的博客比较少
所以先在Windows上搭建了

###Less-1

Java学习tips

发表于 2016-11-26

Android学习tips

发表于 2016-11-26

p416

发表于 2016-11-23 | 分类于 blog

LeetCode p416 Partition Equal Subset Sum 题解

1.题目:

Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Note:

Each of the array element will not exceed 100.
The array size will not exceed 200.

Example 1:

Input: [1, 5, 11, 5]

Output: true

Explanation: The array can be partitioned as [1, 5, 5] and [11].

Example 2:

Input: [1, 2, 3, 5]

Output: false

Explanation: The array cannot be partitioned into equal sum subsets.

阅读全文 »

p393

发表于 2016-10-19 | 分类于 blog

LeetCode p393 UTF-8 Validation 题解

1.题目:

A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:

For 1-byte character, the first bit is a 0, followed by its unicode code.
For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by n-1 bytes with most significant 2 bits being 10.

This is how the UTF-8 encoding would work:

Char. number range | UTF-8 octet sequence
(hexadecimal) | (binary)
——————–+———————————————
0000 0000-0000 007F | 0xxxxxxx
0000 0080-0000 07FF | 110xxxxx 10xxxxxx
0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

Given an array of integers representing the data, return whether it is a valid utf-8 encoding.

阅读全文 »

HeartLineDemo

发表于 2016-10-16 | 分类于 blog

Android_HeartLineDemo

实现一个沿心形曲线运动的动画

用到的知识:

  • 自定义View初级
  • 贝塞尔曲线
  • path组合路径
  • Android属性动画之ObjectAnimator
阅读全文 »
1…121314…33
ZhangMengRou

ZhangMengRou

ZMR小站

230 日志
4 分类
14 标签
© 2019 ZhangMengRou
由 Hexo 强力驱动
|
主题 — NexT.Gemini v5.1.4