You are given a C++ class that manages a dynamically allocated array of bytes.
This buffer represents an exclusively owned resource, meaning:
Two objects of this class already exist. Your task is to ensure that ownership of the buffer can be safely transferred from one object to another using move assignment.
Your Objectives
You must modify the provided template code to:
⚠️ The provided template code intentionally violates exclusive ownership rules and must fail the test cases.
Only a correct implementation will pass.
Program Flow
NN integers and construct object AMM integers and construct object BA = std::move(B)AB
Expected Behavior After Fix
A contains the values originally stored in BB prints No data
Example Input
4
10 20 30 40 3 1 2 3 Example Output
1 2 3
No data
Constraints
N and M are in the range 1 to 100new[]delete[]
Input
4 10 20 30 40 3 1 2 3
Expected Output
1 2 3 No data