In many systems, a resource is created in one function and used elsewhere.
Modern C++ expresses this ownership transfer explicitly by returning a std::unique_ptr.
Your task is to correctly implement a function that:
std::unique_ptrThe caller must then use the buffer without worrying about cleanup.
This problem focuses on clean ownership flow through return values.
Program Flow:
NNmain
Example Input:
4
10 20 30 40
Example Output:
10 20 30 40
Constraints:
N ranges from 1 to 100std::unique_ptrdelete is allowed
Input
1 0
Expected Output
0