leetle

Daily challenge for 2026-05-12

497. Neighborhood Watch Frequency

You are given a list of house numbers representing a street. A house is considered 'watched' if its house number appears exactly as many times in the list as the value of the house number itself. Return the sum of all unique house numbers that satisfy this condition. If no such house numbers exist, return 0.

Example:
Input: houses = [1, 2, 2, 3, 3, 3, 4]
Output: 6
(House 1 appears once, house 2 appears twice, house 3 appears three times. 1 + 2 + 3 = 6. House 4 appears only once, so it is not included.)

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