Convert this pseudocode to working code
Turn pseudocode into idiomatic, type-annotated working code with a docstring. Handles implicit edge cases the pseudocode glosses over.
Preview
Copy prompt
Convert the following pseudocode into idiomatic, working [Language] code: [Paste pseudocode]. Follow the logic precisely but use language-native patterns and idioms. Add type annotations if the language supports them, handle any edge cases the pseudocode implies but does not state explicitly, and include a brief docstring describing the function's purpose and parameters.
More
Code Generation
Prompts
