Review the faulty code and description. Modify the question text if needed, and write your corrected solution in the code textarea.
Your corrections will be evaluated across 5 key dimensions. For each dimension, you can earn up to 2 points (10 total points per problem):
Does your code use the correct algorithms and control flow? Are edge cases handled properly?
Are your comments clear, accurate, and helpful? Do they explain why the code works, not just what it does?
Does your code avoid unnecessary operations? Are you using the right data structures and algorithms for optimal performance?
Are your variable and function names descriptive? Is your code well-organized and easy to follow?
Does your code meet all the requirements specified in the problem description? Does it return the correct output format?
Important: Be careful not to introduce "false positives" — changes that weren't actually mistakes or that break working functionality.
Evaluating your submission with AI...