Sliding Window Vs Two Pointers: Unlocking Efficient Algorithms