Leetcode
sine49
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode 338 Counting Bits
题目描述: 给一个非负整数n,分别求0到n的n+1个整数的二进制表示中1的个数,结果作为数组输出。 这个题目可以说很简单,无非就是每个数求一下二进制表示中1的个数,然后放到返回的数组里。求二进制1的位数虽然说五花八门,但是相比于数据规模n来说,都是常量时间,对于通常的时间复杂度要求来说,几乎不需要考虑。比如以下几种常见的方法: 1)普通方法,移位法: int countbit(un...原创 2018-10-02 15:44:34 · 201 阅读 · 0 评论 -
Leetcode 899——简单的hard题1
Leetcode 899——简单的hard题1题目描述分析代码Solution 1Solution 2 题目描述 A string S of lowercase letters is given. Then, we may make any number of moves. In each move, we choose one of the first K letters (starting ...原创 2018-12-03 21:14:34 · 278 阅读 · 0 评论 -
LeetCode 279 Perfect Squares
LeetCode 279原创 2019-02-03 19:07:29 · 230 阅读 · 0 评论
分享