You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nested List Comprehension [[item if not item.isspace() else -1 for item in row] for row in board] to build 2D matrix
String Formatting with Padding 0: For example, convert integer 2 to "02" f"{month:02d}"
Math's Ceil & Floor: math.ceil(), math.floor()
Math:
Modular Multiplicative Inverse (MMI): MMI(a, b) = x s.t a*x ≡ 1 (mod n)
For example: a = 3, m = 11 => x = 4 as (3*4) mod 11 = 1
Euclidean Algorithm to find GCD of A & B & Extended Euclidean Algorithm to find MMI(A, B)
Day 4:
LeetCode: Best Time to Buy and Sell Stock (Keep track on the buying price, compare to the next days), Climbing Stairs (At T(n): first step = 1, remaining steps = T(n-1) or first step = 2, remaing steps = T(n-2). This recurrence relationship is similar to Fibonacci number)
Day 5:
LeetCode: 3 Sum, Longest Palindromic Substring and Container With Most Water
Day 6:
LeetCode: Number of Islands, Design Circular Queue