ABC Interview Question

related to sliding window and stacks