Compile error


  • 0
    L

    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!!!!!!!!!!!!!


  • 0
    S

    Pay attention to the code definition. The function needs to complete is not subsetsWithDup.

    Check out how to get back clean definition from OJ FAQ.


  • 0
    L

    thanks ,maybe i should learn from the giving back information ,maybe i should solve problem by myself , but all thank (I.m Chinese, my English is soso,just forgive me my poor English)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.