Back to problems

Find the Most Frequent Log Call

Algorithm · Roblox · Easy

Given a list logs, where each element is the name of a function or API call made by the system, write a function that returns the call that appears most often, together with how many times it appears, as a pair (call, frequency). If multiple calls have the same highest frequency, return the one whose first occurrence has the smallest index in logs. If logs is empty, return ("", 0). Example 1: Explanation: "write" appears 3 times, while every other call appears at most 2…

Checking your access…