Does the Course Cover the Syllabus?

Medium ⏱ 12 min 59% acceptance ★★★★☆ 4.4
Write covers(course_topics, syllabus) returning a tuple (ok, missing) where ok is True when the course covers every syllabus topic, and missing is a sorted list of the syllabus topics the course lacks (empty when ok is True).

Examples

Example 1
Input
covers(['loops', 'oop', 'sets'], ['loops', 'regex'])
Output
(False, ['regex'])
Explanation

regex is required but not covered.

Constraints

  • missing must be sorted.
  • Return a tuple, not two values via a list.

Topics

Setssuperset

Companies

CourseraInfosysCapgemini

Hints

Hint 1

Set difference syllabus - course gives the gaps.

Hint 2

ok is just "no gaps".

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.