Kadane
LeetCode 3984: Divisible Game
·3 mins
LeetCode
Medium
Dynamic-Programming
Kadane
Math
Number-Theory
Enumeration
LeetCode 3984 note: replacing a composite k by one of its prime factors only helps (more values divisible, smaller k), so try every prime factor of the numbers plus 2, running Kadane once per candidate
LeetCode 53: Maximum Subarray
·3 mins
LeetCode
Medium
Dynamic-Programming
Kadane
LeetCode note for Maximum Subarray, rebuilt from the original learning note
Kadane's Algorithm
·2 mins
Algorithm
Kadane
Dynamic-Programming
Array
Maximum subarray DP with an ending-here invariant