- 博客(26)
- 收藏
- 关注
原创 191. 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.
2016-12-27 17:33:26 244
原创 70. Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
2016-12-26 14:16:02 192
原创 437. Path Sum III
You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but it must go downwards (traveling only from parent nodes to chil
2016-12-23 14:48:48 215
原创 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 [1, n] inclusive that do not appear in this array.Could you do it without extra space and in O(n) runtime? You
2016-12-21 16:23:36 248
原创 461. Hamming Distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.
2016-12-19 17:48:14 218
原创 113. Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
2016-12-16 17:50:56 199
原创 112. Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
2016-12-16 17:25:59 163
原创 83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
2016-12-16 16:45:14 173
原创 Android 如何生成一个aar或者JAR包
Eclipse:右键项目选择export 选择JAR file,然后只打包src目录下的就可以了。Android Studio:如果想直接依赖同一个项目下的module的话可以在目标项目下build.gradle的dependencies中添加compile project(':module名称')如果不在同一个项目下,首先需要新建一个library项目然后在src目录下coding最后build...
2016-12-16 16:24:24 1832
原创 342. Power of Four
Given an integer (signed 32 bits), write a function to check whether it is a power of 4.
2016-12-15 15:31:09 257
原创 326. Power of Three
Given an integer, write a function to determine if it is a power of three.
2016-12-15 14:52:56 186
原创 231. Power of Two
Given an integer, write a function to determine if it is a power of two.
2016-12-15 14:28:18 216
原创 459. Repeated Substring Pattern
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase English letters only and its length will not exceed 10000.
2016-12-14 15:57:14 290
转载 Android 布局文件添加edittext报:The following classes could not be found错误
布局文件添加edittext报:The following classes could not be found错误解决方案
2016-12-12 10:19:46 1466
原创 Android ListView在有checkbox的情况下上下滑动选中状态错误以及position错乱
ListView在有checkbox的情况下上下滑动选中状态错误的解决方法
2016-12-11 19:26:30 647
原创 454. 4Sum II
Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make problem a bit easier, all A, B, C, D have same length of N where 0 ≤ N ≤ 500. All integers are in the range
2016-12-06 17:54:03 576
原创 434. Number of Segments in a String
Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.Please note that the string does not contain any non-printable characters.
2016-12-05 14:36:17 755
原创 241. Different Ways to Add Parentheses
Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.
2016-12-05 13:53:55 160
原创 337. House Robber III
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this plac
2016-12-02 17:10:40 188
原创 216. Combination Sum III
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.
2016-12-02 16:17:33 138
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人