- 博客(8)
- 收藏
- 关注
原创 Leetcode--137.Single Number II
题目Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you
2017-06-30 20:32:07 344
原创 Leetcode--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 implement it without using extra
2017-06-30 20:01:51 247
原创 Leetcode--326. Power of Three
题目Given an integer, write a function to determine if it is a power of three.Follow up: Could you do it without using any loop / recursion?Credits: Special thanks to @dietpepsi for adding this problem
2017-06-30 19:50:01 259
原创 Leetcode--89. Gray Code
题目The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of gra
2017-06-30 19:26:20 341
原创 Leetcode--231、Power of Two
题目Given an integer, write a function to determine if it is a power of two.思路如果是2的幂,则二进制的所有位中,有且仅有一个1。 可以复用 “Number of 1 Bits” 中的函数,计算出1的个数,如果为1,则返回true, 不为1,返回 false。 还有更巧妙的办法。如果一个数是2的幂,则它的二进制最高位必然为1
2017-06-30 17:25:29 226
原创 Leetcode--268. Missing Number
一、题目Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.For example, Given nums = [0, 1, 3] return 2.Note: Your algorithm should run in
2017-06-30 16:26:58 265
原创 Leetcode--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 guaranteed to fit within the range of a
2017-06-30 15:48:49 226
原创 Ubuntu-Python2.7安装 scipy,numpy,matplotlib
sudo apt-get install python-scipysudo apt-get install python-numpysudo apt-get install python-matplotlibpythonimport scipyimport numpyimport pylabscipy.test()numpy.test()pylab.test()
2017-06-02 16:11:31 3952 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人