Combination is "permutation with repetition where there are only 2 kinds"
Combination can be expressed using binomial cofficient
Multinomial coefficient is "permutation with repetition"
Multinomial coefficient can expressed using the product of prefix binomials.
also
C(n, r) = C(n-1, r-1) + C(n-1, r)
#lessons
Combination can be expressed using binomial cofficient
Multinomial coefficient is "permutation with repetition"
Multinomial coefficient can expressed using the product of prefix binomials.
also
C(n, r) = C(n-1, r-1) + C(n-1, r)
#lessons
community course has been empty (on the english version) for a while, but now they have added some lessons to it. you can access them here.
https://codeforces.com/edu/course/3
https://codeforces.com/edu/course/3
👍3
Forwarded from Dagmawi Babi 🇪🇹
Lee Robinson's course on how to use and understand AI in dev. A pretty quality resource.
AI (in dev) Foundations
• cursor.com/learn
Or on YouTube
• youtube.com/playlist?list=PLuI2ZfvGpzwCEXrl_K6bW5OqNpZq3HkMa
#Resources #Cursor #Tutorials
@Dagmawi_Babi
AI (in dev) Foundations
• cursor.com/learn
Or on YouTube
• youtube.com/playlist?list=PLuI2ZfvGpzwCEXrl_K6bW5OqNpZq3HkMa
#Resources #Cursor #Tutorials
@Dagmawi_Babi
how to know if a node is an ancestor of another node in a tree?
first let's have a global variable that tracks time, which starts from zero.
when traversing the tree using dfs, track the "in" and "out" time of each node.
- "in" time = is the time at which the recursive dfs function is on that node.
- "out" time = is the time after the dfs function traversed every child and grand children of the current node.
to show it in code.
let "x" be a node and "y" be another that node. then we can check "x" is an ancestor of "y",
if in(x) < in(y) < out(x).
#lessons
first let's have a global variable that tracks time, which starts from zero.
when traversing the tree using dfs, track the "in" and "out" time of each node.
- "in" time = is the time at which the recursive dfs function is on that node.
- "out" time = is the time after the dfs function traversed every child and grand children of the current node.
to show it in code.
def dfs(node):
# "in" time is here
for child in graph[node]:
dfs(child)
# "out" time is here
let "x" be a node and "y" be another that node. then we can check "x" is an ancestor of "y",
if in(x) < in(y) < out(x).
#lessons
Binlogs
how to know if a node is an ancestor of another node in a tree? first let's have a global variable that tracks time, which starts from zero. when traversing the tree using dfs, track the "in" and "out" time of each node. - "in" time = is the time at which…
AtCoder
E - Count Descendants
AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online.
LeetCode
Find Sum of Array Product of Magical Sequences - LeetCode
Can you solve this real interview question? Find Sum of Array Product of Magical Sequences - You are given two integers, m and k, and an integer array nums.
A sequence of integers seq is called magical if:
* seq has a size of m.
* 0 <= seq[i] < nums.length…
A sequence of integers seq is called magical if:
* seq has a size of m.
* 0 <= seq[i] < nums.length…
https://leetcode.com/problems/find-sum-of-array-product-of-magical-sequences/
I couldn't solve it. can you?
I couldn't solve it. can you?