1359. Count All Valid Pickup and Delivery Options
1359. Count All Valid Pickup and Delivery Options
Description
Given n
orders, each order consists of a pickup and a delivery service.
Count all valid pickup/delivery possible sequences such that delivery(i) is always after ofpickup(i).
Since the answermay be too large,return it modulo10^9 + 7.
Example 1:
1 | Input: n = 1 |
Example 2:
1 | Input: n = 2 |
Example 3:
1 | Input: n = 3 |
Constraints:
1 <= n <= 500
Hints/Notes
- 2025/04/14 Q3
- dp
- 0x3Fâs solution
Solution
Language: C++
1 | class Solution { |