Array=0824

public static String getLongPrefix(String[] strs) {
    if(strs.length == 0||strs == null) {return null;}
    for(int i = 0; i getSubsets(int[] nums) {
    List ansList = new ArrayList<> ();
    List oneList = new ArrayList();
    if(nums==null||nums.length==0) {return ansList;}
    Arrays.sort(nums);
    dfs(nums,0,oneList,ansList);
    ansList.add(new ArrayList());
    return ansList;
}

private static void dfs(int[] nums, int start, List oneList,List ansList) {
    for (int i=start; i(oneList));
        dfs(nums,i+1,oneList,ansList);
        oneList.remove(oneList.size()-1);
    }

}

你可能感兴趣的:(Array=0824)