Figure this code?
I have just finished writing this code, and it occurred to me that on its own, it makes very little sense.
private static int RedactedFunctionName(List<int> a, List<int> b) { List<int> n,m; if (a.Count > b.Count) { n = a; m = b; } else { n = b; m = a; } int nSize = n.Count; int mSize = m.Count; double o1 = nSize + mSize; double o2 = nSize * Math.Log(mSize, 2); int result = 0; if (o1 < o2) { int mi = 0, ni = 0; while (mi < mSize && ni < nSize) { if (n[ni] > m[mi]) { mi++; } else if (n[ni] < m[mi]) { ni++; } else { ni++; mi++; result++; } } } else { for (int i = 0; i < mSize; i++) { if (n.BinarySearch(m[i]) >= 0) result++; } } return result; }
Can you figure out what this function does, why is it behaving in this manner, and what preconditions it expects?

Comments
Comment preview