From 511381119d8228de09c2fb57a3b4c3ce0163bee5 Mon Sep 17 00:00:00 2001 From: life <13122192336@163.com> Date: Sat, 4 Mar 2023 18:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=8F=98=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E4=B8=8A=E9=9D=A2=E9=83=BD=E6=98=AFresSet=E4=B8=8B=E9=9D=A2?= =?UTF-8?q?=E5=86=99=E6=88=90=E4=BA=86setRes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0349.两个数组的交集.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/problems/0349.两个数组的交集.md b/problems/0349.两个数组的交集.md index ed6a5d97..347d1094 100644 --- a/problems/0349.两个数组的交集.md +++ b/problems/0349.两个数组的交集.md @@ -143,9 +143,9 @@ class Solution { return resSet.stream().mapToInt(x -> x).toArray(); //方法2:另外申请一个数组存放setRes中的元素,最后返回数组 - int[] arr = new int[setRes.size()]; + int[] arr = new int[resSet.size()]; int j = 0; - for(int i : setRes){ + for(int i : resSet){ arr[j++] = i; }