Skip to content
DeepForgeby svx
All problems
EasyNLPnlp-222

Layout Region Count

Problem

Return a dictionary counting how many regions of each label appear in the label list.

An empty label list gives an empty dictionary.

Hint

Increment a dictionary entry per label occurrence.

Test cases

case 1
in: [["text","title","text"]]
expected: {"text":2,"title":1}
case 2
in: [[]]
expected: {}
case 3
in: [["a"]]
expected: {"a":1}
Starter codePython
def layout_region_count(labels):
    # Your code here
    pass

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