def METHOD_NAME(perm: np.ndarray) -> np.ndarray:
    """
    Returns inverse permutation.
    Args:
        perm: permutation to be reversed.
    Returns:
        inverse permutation.
    """
    inv = np.zeros_like(perm)
    inv[perm] = np.arange(perm.size, dtype=np.int64)
    return inv