You are given a program that allocates a dynamic buffer inside a limited scope.
Your task is to manage this buffer using std::unique_ptr so that the memory is released automatically when the scope ends, without calling delete.
This problem introduces the core idea of RAII (Resource Acquisition Is Initialization), where resource lifetime is tied to object lifetime.
Program Flow:
NN integersN integers into the buffer
Example Input:
4
10 20 30 40
Example Output:
10 20 30 40
Scope ended
Constraints:
N ranges from 1 to 100std::unique_ptr for ownershipdelete explicitly
Input
1 0
Expected Output
0 Scope ended