Implement solve(text, mode) using Python's re module:
"emails" → return a list of all email addresses found in text."words_starting_f" → return a list of all words starting with f (lowercase only)."deduplicate" → return the text with any consecutive duplicate words replaced by a single instance (e.g. "the the cat" → "the cat").Examples
solve("Contact alice@x.com or bob@y.org for help", "emails") → ["alice@x.com", "bob@y.org"]solve("which foot or hand fell fastest", "words_starting_f") → ["foot", "fell", "fastest"]solve("cat in the the hat", "deduplicate") → "cat in the hat"Sample tests