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
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