← ALL NOTES
Array

1394. Find Lucky Integer in an Array

A "lucky" integer equals its own frequency in the array; return the largest lucky integer, or −1. Since values are bounded (≤ 500), count with a fixed-size array, then scan values from high to low —…

Loading…