[原题链接][https://leetcode cn.com/problems/best time to buy and sell stock iii/] 分析:动态规划+二分法。以 为分界线,计算第i天之前进行 的最大收益 ,和第i天之后进行 的最大收益 ,最后遍历一遍找到 ,就是最大收益。第i天 ...
分类:
其他好文 时间:
2018-12-31 00:33:04
阅读次数:
185
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 t ...
分类:
其他好文 时间:
2018-12-30 11:44:08
阅读次数:
164
如上代码,三张图片一行均分布局,LinearLayout + android:layout_weight="1" 很正常的做法。使用glide给图片绑定。 结果-->>>>>图片全出不来。 简单分析也不知道哪个环节出问题了。根本问题是图片的宽高没了。 项目紧先给个解决方案,后期再分析原因。 改用ta ...
分类:
移动开发 时间:
2018-12-26 11:39:43
阅读次数:
160
一、理论部分 1、多线程并发执行中的问题 i.多个线程相对执行的顺序是不确定的。 ii.线程执行顺序的不确定性会产生执行结果的不确定性。 iii.在多线程对共享数据操作时常常会产生这种不确定性。 2、线程的同步 -多线程并发运行不确定性问题解决方案:引入线程同步机制,使得另一线程要使用该方法,就只能 ...
分类:
编程语言 时间:
2018-12-23 15:24:26
阅读次数:
226
买卖股票的最佳时机III 给定一个数组,它的第 i 个元素是一支给定的股票在第 i 天的价格。 设计一个算法来计算你所能获取的最大利润。你最多可以完成 两笔 交易。 注意: 你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。 示例 1: 输入: [3,3,5,0,0,3,1,4] 输出: ...
分类:
其他好文 时间:
2018-12-23 11:24:32
阅读次数:
162
There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up(u), down (d), left (l) or right (r), but it ...
分类:
其他好文 时间:
2018-12-22 11:44:21
阅读次数:
195
echarts.init(document.getElementById('WaterCategoryStatistics')).setOption({ legend: { orient:'vertical', left:'left', data: ['II', 'III', 'IV', 'V', ...
分类:
其他好文 时间:
2018-12-19 13:10:19
阅读次数:
525
一、CSS边框空白 padding-top:10px; /*上边框留空白*/ padding-right:10px; /*右边框留空白*/ padding-bottom:10px; /*下边框留空白*/ padding-left:10px; /*左边框留空白 二、CSS符号属性 list-style ...
分类:
Web程序 时间:
2018-12-18 15:54:48
阅读次数:
184
串口发送部分代码: 串口接收部分代码: 例程: http://www.openedv.com/forum.php?mod=attachment&aid=Njg0MnxmMzFkMzdmN3wxNTQ1MDQ0NjE5fDB8MzM2MTE%3D ...
分类:
其他好文 时间:
2018-12-17 20:12:16
阅读次数:
194
样例:root = [10,5,-3,3,2,null,11,3,-2,null,1], sum = 7,一开始以为10 5 -3也算一种情况,但实际上是不算的。 /** * Definition for a binary tree node. * public class TreeNode { *... ...
分类:
其他好文 时间:
2018-12-12 23:51:24
阅读次数:
193