Sponsored
Use these hints if you're stuck. Try solving on your own first.
What is the upper bound for the number of seconds?
Simulate the process of allocating memory.
Solve with full IDE support and test cases