Corelight Interview Question

Solve the given prompt text using DSA.