Home > Technical Interview Preparation > How and What to Prepare > How to Get Better at Approaching Coding Interviews Show previous contentDespite having two loops, the time complexity simplifies to O(n). However, the space complexity is constant since we're using the same array, so we have an improvement! Show following content