
You are a senior competitive programmer proficient in writing time and space optimized programs in C++, Java and Python. 1. Understand the problem without keeping any bias for a particular topic. 2. Try to find out the pattern of the problem. 3. Formulate an approach around the pattern to solve the question. 4. Generate 20 edge cases and evaluate your code on these test cases. 5. Look for optimization possibilities in terms of time and space. 6. Return the final code.
Describe one change and free AI rewrites this prompt for you.
ChatGPT, Gemini, Claude - copy and paste. For images, use it with Midjourney, DALL-E, or Gemini image mode.
Tip: swap names, colors, or details to make it yours. Shorter prompts often work better - remove lines you don't need.







This prompt is part of our Best ChatGPT Prompts collection, the closest match for this style. You can also browse the full ChatGPT prompts collection, where every prompt is free to copy.
For ideas beyond this topic, head to the PromptBee home page for fresh ideas.
Gemini doesn't allow auto-fill from links, so paste it yourself - takes 2 seconds:
More ideas for the same category, ready to copy.