how to do write this method with more efficiency ?

Printable View