Entelect interview question

Optimise code to run effectively with fewer lines of code