React diffs keyed lists. Input: two lines, old keys and new keys (JSON arrays of strings). Print three lines: mounted: N (keys only in new), unmounted: N (keys only in old), kept: N (keys in both).
Input: two JSON arrays. Output: three labeled counts.
Your program reads from stdin and prints to stdout.
Example 1
Input: ["a","b","c"] ["b","c","d"]
Output: mounted: 1 unmounted: 1 kept: 2
Hints
React diffs keyed lists. Input: two lines, old keys and new keys (JSON arrays of strings). Print three lines: mounted: N (keys only in new), unmounted: N (keys only in old), kept: N (keys in both).
Input: two JSON arrays. Output: three labeled counts.
Your program reads from stdin and prints to stdout.
Example 1
Input: ["a","b","c"] ["b","c","d"]
Output: mounted: 1 unmounted: 1 kept: 2
Hints