LeetCode: Sort Colors

Approach 1: Use 3 indexes. i points to current checking element. j
points to the next available position for 0. k points to the next
available position for 2. Init j=0, k=length-1, i=0. Loop until i<=k,
and when A[i]=0, swap A[i] and A[j], i++, j++, continue. When A[i]=1,
i++, j and k do not move. When A[i]=2, swap A[i] and A[k], k—, but do
not move i, continue.