How this code convert to arduino
<p>I have a problem with implement this python algorithm to arduino. Help me to do this..</p>

<pre><code>def Process(lst):
    for k in range(len(lst)):
        for i in range(len(lst)-1):
            if abs(lst[i]-lst[i+1])==2 and lst[i+1]!=0:
                for j in range(i,len(lst)-2):
                    lst[j]=lst[j+2]
                lst[-1]=lst[-2]=0
    return(lst)
</code></pre>

<p>Some ideas to get you started:
You don't really have lists in C on the Arduino. A data structure you could use there is an array. See <a href="https://www.arduino.cc/en/Reference/Array" rel="nofollow">https://www.arduino.cc/en/Reference/Array</a> for more info.</p>

<p>Passing around arrays to e.g. functions is done via a pointer to the first element of the array. Since this is not enough information to determine the size of an array you typically also provide the size/number of elements. This leads to a possible signature of the function:</p>

<pre><code>int* process(int* lst, int numberOfElements) { ... }     
</code></pre>

<p><code>range(n)</code> in Python returns all numbers from 0 to n-1. In order to do the same in C and iterate over the elements of an array you basically loop from 0 to numberOfElements-1. You can then access the elements in the array by their index, i.e.:</p>

<pre><code>for(int i = 0; i &lt; numberOfElements; i++) {
    (...)
    lst[i] = lst[j + 2];
}
</code></pre>

<p>Hope this is enough information to get you started.</p>

python arduino