🔥 3-day streak
GitHub Copilot150 / 190
Question 150 of 190

A developer is writing a `parseDuration` function that converts strings like "2h30m" into total seconds. Using Copilot Chat, they provide a few-shot prompt with three examples: "1h" → 3600, "45m" → 2700, "2h30m" → 9000. The generated implementation works for these but crashes on empty strings and inputs like "90m" (which should exceed an hour). What is the most effective refinement to the few-shot prompt to produce more robust code?

Reviewed for accuracy · Report an issueNext question