Sliding Window Algorithm Variable Size Array In C