Sliding window is an advance version or enhancement of two pointers. With two pointers one more input called window size is added then problem belongs to sliding window but in two pointers you have to only find a single output or iterate with two pointer but in sliding window you have a window size that you have to maintain while iterating and in some sliding window question you have a answer and find size of window.