From 9adfbdf343963ee16696aa85f0846fe544105430 Mon Sep 17 00:00:00 2001 From: Ajay <86017484+ajay2614@users.noreply.github.com> Date: Fri, 19 May 2023 13:05:04 +0530 Subject: [PATCH] Create 442_Find_All_Duplicates_in_an_Array.java (#81) Contributed by @ajay2614 --- java/442_Find_All_Duplicates_in_an_Array.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 java/442_Find_All_Duplicates_in_an_Array.java diff --git a/java/442_Find_All_Duplicates_in_an_Array.java b/java/442_Find_All_Duplicates_in_an_Array.java new file mode 100644 index 0000000..b12d6f5 --- /dev/null +++ b/java/442_Find_All_Duplicates_in_an_Array.java @@ -0,0 +1,17 @@ +class Solution { + public List findDuplicates(int[] nums) { + int n = nums.length; + + List ans = new ArrayList<>(); + + for(int i=0;i