FunctionRacerProblemsRace

Classes With Many Students

EasypandasPython

enrolled has columns student and cls, one row per student in a class (no student is listed twice for the same class). Return the classes that have at least k students, in alphabetical order.

Example 1

enrolled {"student":["a","b","c","a"],"cls":["math","math","math","art"]}
k 2
returns ["math"]

math has 3 students, art only 1.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems