Advanced
Logic Bug Identifier
Identify logical errors in a provided function.
📝 Contenuto del prompt
Review the following function for logical errors or edge cases that might cause it to fail. Identify the specific bug, explain why it happens, and provide a corrected version of the code.