Improve commonacnestor improvement by using a single loop instead of two shift()s http://jsperf.com/two-array-shift-vs-for