欢迎光临散文网 会员登陆 & 注册

郭加磊数据基础入门

2022-10-05 23:43 作者:芢依稀久忆0  | 我要投稿

// 左右两侧数组中出现次数最多的数字不相同        int leftCount = getCount(nums, start, mid - 1, left);        int rightCount = getCount(nums, mid, end, right);        if (leftCount > rightCount) {            return left;        }        return right;    }    public int getCount(int[] nums, int start, int end, int target) {        return (int) IntStream.range(start, end + 1).filter(i -> nums[i] == target).count();    }}

郭加磊数据基础入门的评论 (共 条)

分享到微博请遵守国家法律