Search⌘ K
AI Features

Challenge: Sets, Counter and Dictionaries

Explore how to use Python's built-in sets, OrderedDict, and Counter to solve common coding challenges such as identifying missing numbers in a range, finding the first non-repeating character in a string, and grouping words into sorted anagram lists.

We'll cover the following...

Problem 1

You are given a list of integers that should contain all numbers from 1 to n, but some numbers are missing (and the list may have duplicates).
Your task is to return a sorted list of missing numbers.

Use a set to solve this efficiently.

Example input

 ...