Is it an efficient code?
Detailed explanation