Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Solve for even and odd numbers separately.
Greedily match smallest even element from nums to smallest even element from target, then similarly next smallest element and so on.
Similarly, match odd elements too.