Move your files from a drive to another one
Is there anyway that you can move file from a drive to another one? If the files are not large or just a small batch, just do it manually. But what about if you have 1 TB, or even 10TB, and almos...
Is there anyway that you can move file from a drive to another one? If the files are not large or just a small batch, just do it manually. But what about if you have 1 TB, or even 10TB, and almos...
I created two websites by quarto: some R language notes at R Note for Statistics Learning and Computing, and some projects will be posted at Daniel Cheung’s Projects You can download it at quarto....
Assume you’re calculating a great number. However, the number is very large and you’re required to return the number mod $10^9+7$. This is really common in algorithm problems and $10^9+7$ is a larg...
bisect FUNCTIONS import bisect testArray = [1,2,3,3,3,5,5,6,7,8] # 1 2 print(bisect.bisect_left(testArray, 2), bisect.bisect_right(testArray, 2)) # 2 5 print(bisect.bisect_left(testArray, 3), bis...
LeetCode 3850. Count Sequences to K Intuition The subproblem is, how many steps start from $DP[i,c_2,c_3,c_5]$ to $DP[i+1,c_2,c_3,c_5]$, then find $DP[n, t_2,t_3,t_5]$ This sounds difficult to fi...
LeetCode 1653. Minimum Deletions to Make String Balanced Intuition What is a balanced string? In this problem, for every $i < j$ there is no $s[i] = b$ and $s[j] = a$. We can conclude: the bal...
stratascratch 2054 Consecutive Days Intuition & Approach The question requires to write a sql query to find any user who has 3 consecutive days with activity. Step 1: Simple Intutive Solutio...
LeetCode 3830 Longest Alternating Subarray After Removing At Most One Element Intuition & Approach Step 1: Subproblem What is the purpose of this problem? increase, decrease, increase, decre...
Continuous Distributions Basic Definitions PDF ($f(x)$): \(P(X \in B) = \int_B f(x)dx, \quad P(a \le X \le b) = \int_a^b f(x)dx\) Properties: $f(x) \ge 0$ and $\int_{-\infty}^{\infty} f(x)dx = 1$...
Leetcode 2435. Paths in Matrix Whose Sum Is Divisible by K Intuition Step1: subproblem. This can be 3D DP: $DP[i][j][k]$ indicate the #(routes) from $[0,0]$ to $[i,j]$ with value k. Then the goa...