28. Telemetry Packet Memory Cleanup

Back To All Submissions
Previous Submission
Next Submission
#include <iostream>
using namespace std;

int main() {
    int firstValue, secondValue;
    cin >> firstValue >> secondValue;

    int *packet1=new int(firstValue);
    delete packet1;

    int *packet2=new int(secondValue);
    cout<<*packet2;

    delete packet2;

    // Write your dynamic allocation logic here

    return 0;
}

Solving Approach

 

 

 

 

 

 

Was this helpful?
Upvote
Downvote