this code works well on my computer,but when i submit to de websit ,it gives me an compile error,anyone helps?

```
import java.util.ArrayList;
import java.util.List;
public class Solution
{
public static List<List<Integer>> subsetsWithDup(int[] num)
{
List<List<Integer>> result=new ArrayList<>();
result.add(new ArrayList<>());
for(int i =0;i<num.length;i++)
{
ArrayList<ArrayList<Integer>> subset=new ArrayList<>();
for(int j=0;j<result.size();j++){
ArrayList<Integer> elem=new ArrayList<>();
elem.addAll(result.get(j));
elem.add(num[i]);
subset.add(elem);
}
result.addAll(subset);
}
return result;
}
}
```

thanks!!!!!!!!!!!!!