public int[] getIntersection(int[] a, int[] b) {
		int iA = 0, iB = 0, iC = 0;

		int[] c = new int[a.length < b.length ? a.length : b.length];
		while (iA < a.length && iB < b.length) {
			if (a[iA] == b[iB]) {
				c[iC] = a[iA];
				iC++;
				iA++;
				iB++;
			} else if (a[iA] > b[iB]) {
				iB++;
			} else
				iA++;
		}

		// the result array needs to be processed, I skipped
		return c;

	}