You learned monotonic queue improvement for DP:
Recognize sliding window min/max in DP transitions.
Use decreasing deque for max, increasing deque for min.
Remove expired indices from front, dominated indices from back.
Each element enters and exits once, giving total time. You solved four problems: Sliding Window Maximum (foundation), Jump Game VI (basic DP), Constrained Subsequence Sum (optional inclusion), and Shortest Subarray (prefix sums). You now have a effective improvement technique.