hard
Explain and Refactor Code
Analyze a code snippet for readability and suggest optimizations.
📝 提示内容
Review the following function [insert function here]. Explain step-by-step what it does, identify any potential performance bottlenecks, and provide a refactored version that improves readability and efficiency.