Back to problems

Count Nested Key Pairs and Return Most Frequent Inner Key

Algorithm · Google · Medium

Problem: Count Nested Key Pairs and Return the Most Frequent Inner Key You receive a sequence named records. Each element is a two-item list or tuple of the form [outer, inner]. Build the following functionality: Tally each (outer, inner) combination and produce a nested dictionary: Follow-up 1: Using those nested counts, identify the most common inner value associated with each outer: When several inner values share the highest count, choose the lexicographically earliest…

Checking your access…