The Wells Fargo Mobile app may analyze ordered transaction-event sequences. Given a main array and a candidate array, determine whether the candidate occurs as a contiguous subarray of the main array.
A candidate is a subarray only when its elements appear consecutively and in the same order. Return True if it occurs, and False otherwise. An empty candidate array is considered a subarray of every array.
Implement is_subarray(main, candidate).
main and candidate.candidate appears contiguously within main.O(n + m) solution, where n is the length of main and m is the length of candidate.def is_subarray(main, candidate):