Sponsored
Use these hints if you're stuck. Try solving on your own first.
Build an array of size 2 * n and assign num[i] to ans[i] and ans[i + n]
Solve with full IDE support and test cases