advanced
Code Refactoring
Refactor a specific snippet of code for better readability and performance.
📝 प्रॉम्ट सामग्री
Review the provided Python function and refactor it to improve readability and reduce time complexity. Explain the changes you made: [Insert code here]