Printable View
Odd, it looks like O(n^2) to me.
The nested while loop looks like O(n^2), but at most you traverse both arrays once, leading to 2n time, or O(n).