/* For every number at i, Flip the number. If the number is repeated next time and if number is less than 0, then it's a duplicate. Add this number to result. T - O(n) S - O(1) */ class Solution { public List findDuplicates(int[] nums) { List result = new ArrayList<>(); for(int i=0; i findDuplicates(int[] nums) { List ans=new ArrayList<>(); int n=nums.length; int[] freq=new int[n]; for(int i=0 ; i