Implement sqrt and parity-based array rearrangement | Deshaw Interview Question