I need a algorithm which will pop the array element from the first index and push the next element (from the original array at last index) until the matching set of elements found.
Like below:
Original array : {10,20,30,40,50,60,70,80,90,100,110,120}
1st iteration : 10,20,30,40
2nd iteration : 20,30,40,50
3rd iteration : 30,40,50,60
4th iteration : 40,50,60,70 .... and so on until the matching criteria set found.
Logic should iterate until the required set of array element found.(based on some calculations on elements)
ArraySegmentto do easy calculations on the set of 5.