Problems

Debounced Click Handler

HardReact Events

A debounced handler (delay d) runs only if no further click arrives within d ms. Input: line 1 — d; line 2 — JSON array of click timestamps (ascending). Print how many times the handler actually runs.

Input: two lines. Output: run count.

Your program reads from stdin and prints to stdout.

Example 1

Input: 100 [0,50,90,300]

Output: 2

Hints

ReactEventsDebounce