Pure components return identical output for identical props. Input: a JSON array of render records {"component": string, "props": string, "output": string}. Print components that returned DIFFERENT outputs for the same props (sorted, unique), or all pure.
Input: one JSON array.
Output: offender names or all pure.
Your program reads from stdin and prints to stdout.
Example 1
Input: [{"component":"A","props":"x","output":"1"},{"component":"A","props":"x","output":"2"},{"component":"B","props":"y","output":"3"}]
Output: A
Hints
Pure components return identical output for identical props. Input: a JSON array of render records {"component": string, "props": string, "output": string}. Print components that returned DIFFERENT outputs for the same props (sorted, unique), or all pure.
Input: one JSON array.
Output: offender names or all pure.
Your program reads from stdin and prints to stdout.
Example 1
Input: [{"component":"A","props":"x","output":"1"},{"component":"A","props":"x","output":"2"},{"component":"B","props":"y","output":"3"}]
Output: A
Hints