Skip to main content

Practice · 2 of 3

Predict Destruction Order

CHALLENGE
Difficulty: advanced+25 XP

Implement teardownOrder(int n) returning the destruction order of n guard objects numbered 1..n constructed in order inside one scope, as a comma-joined string like "3,2,1".

Back to lesson: Practice: Lifetime Clinic