Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a data structure to save the plate status. You may need to operate the exact index. Maintain the leftmost vacant stack and the rightmost non-empty stack.
Use a list of stack to store the plate status. Use heap to maintain the leftmost and rightmost valid stack.