Medium
Refactor Legacy Code
Refactor a given snippet of legacy code to improve readability and performance while maintaining functionality.
📝 Nội dung Prompt
Analyze the following code snippet and refactor it. Focus on improving readability, reducing complexity, and fixing potential bugs without changing the core logic. Add comments explaining your changes.