原创 Ksum問題 (leetcode)

1,15,16,18 轉載自:http://www.sigmainfy.com/blog/summary-of-ksum-problems.html 方法一:暴力搜索法 時間複雜度O(n^k) 方法二:排序 2sum:採用快速排序

原创 31. Next Permutation (python)

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. I

原创 11. Container With Most Water (python)

Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are

原创 Hadoop單機模式和僞分佈式搭建教程CentOS

轉載於http://blog.csdn.net/zhshulin/article/details/50410403#t6 按原作者方法,安裝成功 首先說明一下:採用的是新裝的CentOS的環境,利用xshell進行遠程操作來搭建Had

原创 396. Rotate Function (python)

Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k p

原创 66. Plus One (python)

Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that

原创 16. 3Sum Closest (python)

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Retur

原创 Keras安裝配置 windows版本

windows版本: 安裝anaconda 相當於安裝了python 以及各種包 安裝Keras 打開Anaconda Prompt,在命令行中輸入 pip install keras 安裝MinGW 接着上一步,在命令

原创 169. Majority Element (python)

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋

原创 keras安裝配置centos版本

centos版本: 安裝theano 1.1下載theano的zip文件 [https://github.com/Theano/Theano],解壓到~/site-packages/theano目錄下,並命名爲theano

原创 219. Contains Duplicate II (python)

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such

原创 18. 4Sum (python)

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all uni

原创 15. 3Sum (python)

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in t

原创 283. Move Zeroes (python)

Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-

原创 121. Best Time to Buy and Sell Stock (python)

Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to