Code RoomName normalization with edge cases
EasyPrep Room Coding #4637

Name normalization with edge cases

Vibe & agenticAlgorithms & data structuresEntry–Mid~10 min

You need a Python function that turns a messy user-entered name like ' jOHN o'brien ' into a clean title-cased version, 'John O'Brien'. You could describe the rules in words, but there are a lot of little cases (extra spaces, the apostrophe). What's an effective way to prompt the AI so it gets the tricky cases right, and why is showing better than telling here?

Implement
clean_name(raw_name: str) → str
Examples
in[" jOHN o'brien "]out"John O'Brien"
in["mary-jane WATSON"]out"Mary-Jane Watson"
in["de la cruz"]out"De La Cruz"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 10 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.