Your question is Find Common Vulnerabilities. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Aurora Innovation security tooling produces vulnerability findings for its codebase. Given a list of findings, return the k most common vulnerability types.
Each finding is a dictionary with a non-empty string type, a file, and a positive integer line. Count every finding, including multiple findings of the same type in one file. Sort the result by descending frequency. If two types have the same frequency, sort them alphabetically by type so the output is deterministic.
Return a list of dictionaries in the form {"type": vulnerability_type, "count": frequency}. If k exceeds the number of distinct types, return every distinct type.
type, file, and line fieldsdef most_common_vulnerabilities(findings, k):