Remember that your solution is O(n²), mine is O(n)...