Right to left [mp]
Micro pattern¶
Description¶
Scan descending positions when arithmetic, dependencies, or stable placement flow from the suffix toward the prefix.
Problems¶
Least-significant position first¶
Begin at the rightmost digit when carry moves left.
- 66. Plus One (Top Easy)
- 445. Add Two Numbers II (Google Prep)
Suffix accumulation¶
Maintain information about positions following the current index.
- 238. Product of Array Except Self (Top Hard)
- 315. Count of Smaller Numbers After Self (Top Hard)
- 2140. Solving Questions With Brainpower (Dynamic Programming)
Stable cumulative placement¶
Traverse records right to left to preserve the order of equal keys.
- Counting sort (DSA)
- LSD radix sort (DSA)
Dependency-safe table updates¶
Iterate indices backward so prior states remain unread and unchanged.
- 115. Distinct Subsequences (Dynamic Programming)
- 516. Longest Palindromic Subsequence (Dynamic Programming)
- 1312. Minimum Insertion Steps to Make a String Palindrome (Dynamic Programming)
- 474. Ones and Zeroes (Dynamic Programming)