akshitagit / CPP

Repository for C++/C codes and algos.
https://github.com/akshitagupta15june
MIT License
495 stars 434 forks source link

optmisation of Ganesha_pattern.cpp #719

Closed Mourya2003 closed 1 year ago

Mourya2003 commented 1 year ago

1.Minimize the number of operations within the loops by pre-calculating repeated values. 2.Avoid unnecessary if-else conditions by simplifying the logic. 3.Reduce code duplication by extracting common patterns into functions. By optimizing the code, we reduced redundancy, simplified the logic, and made it more readable