You are tasked with processing a large log file represented as a list of strings. Each string represents a log entry, and you need to identify the indices of entries that match specific error patterns. The patterns can include substrings and should be case-insensitive.
logs: List of strings, where each string is a log entry.patterns: List of strings representing the error patterns to search for.Example 1:
Input: logs = ["Error: Disk full", "Warning: High CPU usage", "ERROR: Disk not found"], patterns = ["error", "disk"]
Output: [0, 2]
Example 2:
Input: logs = ["Info: System running smoothly", "Warning: Low memory", "Critical: System crash"], patterns = ["critical", "warning"]
Output: [1, 2]
1 <= len(logs) <= 10^5logs = ["Error: Disk full", "Warning: High CPU usage", "ERROR: Disk not found"], patterns = ["error", "disk"]Output[0, 2]WhyEntries 0 and 2 contain the substring 'error' and 'disk', respectively.logs = ["Info: System running smoothly", "Warning: Low memory", "Critical: System crash"], patterns = ["critical", "warning"]Output[1, 2]WhyEntries 1 and 2 contain 'warning' and 'critical', respectively.1 <= len(logs) <= 10^5Each log entry is at most 100 characters longPatterns are non-empty stringsdef find_error_patterns(logs, patterns):