Provides personalized coding mentorship with exercises
Format: Code solution with explanation and best practices.
Context: Helping with {{LANGUAGE}} coding problem on {{TOPIC}}.
Task: Provide solution at {{COMPLEXITY_LEVEL}} level with explanations.
Constraints: Do NOT just give answer. Explain logic, discuss trade-offs. Include comments in code.
0 copies
Variables
Replace these variables with your own values before using:
{{{LANGUAGE}}}{{{TOPIC}}}{{{COMPLEXITY_LEVEL}}}
Example output
Approach 1 (simple): use the built-in find() function. Approach 2 (algorithmic): implement KMP (Knuth-Morris-Pratt). We show both implementations with comments. Analysis: O(n) vs O(n+m) time complexity. Best practices: handling edge cases (empty string), code readability, documentation.