Skip to content
DeepForgeby svx
All problems
MediumProbabilitypr-205

Minimal Cut Count

Problem

Given cut sets as lists of event labels, return the number of distinct minimal cut sets: a set is minimal when no other distinct set in the list is a proper subset of it. Empty cut sets are ignored.

Return 0 for an empty list.

Hint

Drop duplicates first, then remove any set that contains another listed set.

Test cases

case 1
in: [[[1,2,3],[1,2],[1]]]
expected: 1
case 2
in: [[[1,2],[2,3],[3,4]]]
expected: 3
case 3
in: [[[1],[2],[3]]]
expected: 3
case 4
in: [[[1,2],[1,2]]]
expected: 1
case 5
in: [[]]
expected: 0
Starter codePython
def minimal_cut_count(cut_sets):
    # Your code here
    pass

5 test cases · run your code against them in the editor