- 博客(4)
- 收藏
- 关注
原创 面试-数学逻辑题
a,b在[0,1]均匀分布,求E(max(a, b)设Z=max(a, b)分布函数:F(Z)=P(Z<=z)=P(max(a,b))=P(a<=z)P(b<=z)=z^2概密函数:f(z)=2zE(max(a, b))=∫z*f(z)dz=2/3[0,1]上的数与整条数轴上的数哪个多一样多,建立一一映射关系,sigmod函数一副扑克牌,除去大小王,平均分两堆,每堆有两个A的概率...
2018-05-09 21:12:05
3460
原创 编程题总结
最长子串问题思路:lcs,时间复杂度O(n*m),注意子串与子序列区别(扩展:最长回文子串)class Solution: # @param A, B: Two string. # @return: the length of the longest common substring. def longestCommonSubstring(self, A, B): ...
2018-05-08 11:27:14
330
原创 面试-算法类题目
给定一个数组,代表股票价格,找出最高利润思路:以当前股票为基准,找到之前的最小值,用来更新最大收益。class Solution(object): def maxProfit(self, prices): if len(prices)<=1: return 0 low_price = prices[0] ...
2018-05-06 22:30:03
195
转载 python 编程题
Python 排列组合的计算form itertools import combinations, permutations A = list(permutations([1, 2, 3], 2)) C = list(combinations([1, 2, 3], 2))
2018-04-03 19:16:06
388
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅