【leetcode】两个数组间的距离值

 

int findTheDistanceValue(int* arr1, int arr1Size, int* arr2, int arr2Size, int d){
    int count=0,i,j;
    for (i=0; i<arr1Size; i++){
        for (j=0; j<arr2Size; j++)
            if (abs(arr1[i]-arr2[j])<=d) break;
        if (j==arr2Size) count++;
    }
    return count;

 

posted @ 2020-09-28 15:12  温暖了寂寞  阅读(249)  评论(0编辑  收藏  举报