American Express Interview Question

1 from sliding window and other from rotated array.