Palo Alto Networks Interview Question

sliding window, array and string problems