I\'ve googled it but couldn\'t find the right solution for my case. I made a function1 before the code below to get a result in a form of list. So basically, a[i] and a[i+1] are