Part-1 :-
Atlassian tracks various project activities over time, such as issues created, tasks completed, or deployments made each day.
You are given an array representing the activity recorded on consecutive days.
A consistent activity streak is a contiguous sequence of days where the change in activity between every pair of consecutive days remains the same.
Your task is to determine the maximum length of a contiguous consistent activity streak in the given array.
The streak must contain at least two days.
Part-2 :-
Building on the previous activity-streak problem, suppose Atlassian now allows you to modify at most one day's activity value in the data.
You are given the same array representing activity recorded on consecutive days. You may replace at most one element of the array with any integer you choose, including a negative integer.
A consistent activity streak is a contiguous sequence of days where the change in activity between every pair of consecutive days remains the same.
Your task is to determine the maximum possible length of a contiguous consistent activity streak that can be obtained after replacing at most one element in the original array.
You may choose not to modify the array if the existing data already contains the optimal streak.