Design a system that can record security-policy violations for user pins and then efficiently answer queries about those violations.
You must implement a class PinViolationAnalyzer with the following methods:
record_violation(policy_id, pin_id, date) - Record that the given pin violated the given policy on the given date. A pin may violate the same policy many times; each call is a distinct violation. A pin may violate many policies and a policy may be violated by many pins.
query_by_policy(policy_id, start_date, end_date) - Return the number of violations of the given policy that occurred between start_date and end_date inclusive.
query_by_pin(pin_id, start_date, end_date) - Return the number of violations committed by the given pin between start_date and end_date inclusive.
All dates are integers representing days since epoch (e.g., 1, 2, 3, ...). The system must handle up to 10^5 method calls in total, and the queries must be answered efficiently.