Pergunta de entrevista da empresa KoinWorks

Write a function that accepts an array of integers and return a lucky number, which is the largest item in the array that has the same frequency as it's value