- 博客(13)
- 问答 (4)
- 收藏
- 关注
原创 Leetcode-951 Flip Equivalent Binary Trees
951.Flip Equivalent Binary Trees Medium 32413FavoriteShare For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tr...
2019-09-24 20:10:40 107
原创 Leetcode-337 House Robber III
337.House Robber III Medium 176635FavoriteShare 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 h...
2019-09-24 09:26:39 111
原创 Leetcode-238 Product of Array Except Self
Given an arraynumsofnintegers wheren> 1, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i]. Example: Input: [1,2,3,4] Output: [...
2019-03-26 21:53:59 168
原创 Leetcode-169 Majority Element
Given an array of sizen, find the majority element. The majority element is the element that appearsmore than⌊ n/2 ⌋times. You may assume that the array is non-empty and the majority element alwa...
2019-03-26 21:49:44 118
原创 Leetcode-121 Best Time to Buy and Sell Stock
Say you have an array for which theithelement is the price of a given stock on dayi. If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...
2019-03-26 21:42:50 149
原创 Leetcode-122 Best Time to Buy and Sell Stock II
Say you have an array for which theithelement is the price of a given stock on dayi. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy on...
2019-03-26 21:39:00 158
原创 Leetcode-66 Plus One
Given anon-emptyarray of digitsrepresenting a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list, and each element...
2019-03-26 21:34:52 192
原创 Leetcode-15 3Sum
Given an arraynumsofnintegers, are there elementsa,b,cinnumssuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not conta...
2019-03-26 21:27:28 103
原创 Leetcode-561 Array Partition I
Given an array of2nintegers, your task is to group these integers intonpairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as poss...
2019-03-26 21:23:06 111
原创 Leetcode-53 Maximum Subarray
Given an integer arraynums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,4,-1,2,1,-5,4], Output: 6 Explanat...
2019-03-26 21:06:51 123
原创 Leetcode-11 Container With Most Water
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of lineiis at (i,ai) and (i, 0). Find two...
2019-03-26 20:55:35 120
原创 Leetcode-1 Two Sum
题目如下: Given an array of integers, returnindicesof the two numbers such that they add up to a specific target. You may assume that each input would haveexactlyone solution, and you may not use th...
2019-03-26 20:33:36 96
原创 Mac anaconda python 配置libsvm
今天配置这个环境,走了许多弯路,这里记录一下配置的过程。1、https://www.csie.ntu.edu.tw/~cjlin/libsvm/ 在这里下载压缩包到任意地方2、解压到任意地方。3、cd到解压后的文件夹 cd python make4、可以看到在解压后的文件夹中多出了libsvm.so.2这个文件,拷贝这个文件5、因为我使用的是anaconda python,所以将l...
2018-06-01 11:08:06 734
空空如也
关于对象指针数组的析构
2016-06-11
Python socket 聊天器
2015-12-27
Mainloop后的程序怎么运行?
2015-12-23
Python类之间怎么相互调用?
2015-12-23
TA创建的收藏夹 TA关注的收藏夹
TA关注的人