Changchun Master Li

leetcode 239. Sliding Window Maximum

algorithm leetcode

Python暴力通关

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
ret = []
length = len(nums)
if 0 == length:
return []
w = length - k + 1
for i in range(w):
m = max(nums[i:i+k])
ret.append(m)
return ret
Read more

leetcode 126. Word Ladder II

algorithm leetcode
123456789101112131415161718192021222324252627282930313233343536373839404142import stringimport collectionsclass Solution(object): def findLadde ...
Read more

离散随机变量的相对熵和机器学习
KL divergence and Machine Learning

统计学习

目录

  • 熵和交叉熵 基础
  • 相对熵 性质
  • 证明一 Infomation inequality(信息不等性)
  • 证明二 KL and maximum likelihood(极大似然估计相对熵最小)
Read more

we are team

jlu

挂他一科又何妨?

Read more

LeetCode Word Pattern

algorithm leetcode

leetcode

Read more

小马过河

jlu

有一天,住在马棚里的老马对小马说:“你已经长大了,能帮妈妈做点事吗?”小马说:“怎么不能?我很愿意帮您做事。”老马高兴地说:“那好啊,你把这半口袋麦子驮到磨坊去吧。”

Read more

remove-duplicates-from-sorted-list-ii

algorithm leetcode

leetcode

Read more

推荐一本书 -> Linux Sea

Linux Gentoo

在桌面领域

Linux的并不擅长,市场占有率约为3%。然而,你很可能认识几个执着使用Linux的人。如果你考虑过,你估计比大多数人更了解个人操作系统的偏好。

Read more

An Introduction to Machine Learning Theory and Its Applications

统计学习

Machine Learning (ML) is coming into its own, with a growing recognition that ML can play a key role in a wide range of critical applications, such as data mining, natural language processing, image recognition, and expert systems. ML provides potential solutions in all these domains and more, and is set to be a pillar of our future civilization.

Read more

one form to understand Hamming weight 一个表理解汉明重量

algorithm

There are three solutions to calculate hamming weight.

bruce force

1
2
3
4
5
6
7
8
int hammingWeight(uint32_t n) {
int count = 0;
while(n != 0) {
count += n %2;
n = n /2;
}
return count;
}
Read more
Prev Next