public static int partitionArray(ArrayList<Integer> nums, int k) {
	    //write your code here
	    List<Integer>A=nums;
	    int l=0;
	    for (int r=A.size()-1,i=0;i<=r;) {
	        if (A.get(i)<k) {
	            Collections.swap(A,l++,i++);
	        } else {
	            Collections.swap(A,i,r--);
	        }
	    }
	    return l;
    }