leetle

Daily challenge for 2025-12-18

352. Find the Lucky Number

A lucky number is an integer in the array that has a frequency equal to its value.

Given an array of integers arr, return the largest lucky number in the array. If there is no lucky number, return -1.

Example:
Input: arr = [2,2,3,4]
Output: 2

Explanation: 2 appears 2 times, making it the only lucky number.

Example 2:
Input: arr = [1,2,2,3,3,3]
Output: 3

Run this challenge interactively in Python or JavaScript when the app loads.