Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
03
:
10
:
57
Back to Dashboard
[CodeSignal] Portfolio Path Counter
Medium
A warehouse manager starts with initial units of inventory. In one operation, the manager can either restock one unit (increase inventory by 1) or remove one unit (decrease inventory by 1). Inventory can never drop below 0.
Given at most m operations, return the number of distinct operation sequences that result in exactly target units of inventory. Sequences of different lengths are considered distinct (a sequence can stop at any point up to m operations as long as it reaches target). ...