Given a list of log lines lines, where each line is a JSON object with string fields "user" and "event", return a dictionary mapping each user to the number of distinct event types seen for that user. Invalid JSON lines or lines missing either field should be ignored. The solution should process the input in a memory-efficient way and avoid storing parsed records unnecessarily.
1 <= len(lines) <= 10^510^4user and event values, when present, are non-empty strings