Problems

Selector Recompute Count

MediumContext & State Management

A memoized selector recomputes only when its input slice changes. Input: each line is a store snapshot JSON {"items": number[], "theme": string}; the selector depends ONLY on items (deep-equal by JSON). Print the recompute count.

Input: one snapshot per line. Output: number of recomputes.

Your program reads from stdin and prints to stdout.

Example 1

Input: {"items":[1],"theme":"a"} {"items":[1],"theme":"b"} {"items":[1,2],"theme":"b"}

Output: 2

Hints

ReactSelectorsMemoization