给定一组不含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 输入: nums = [1,2,3] 输出: [ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], [] ] 来源:力扣(LeetCode)链 ...
分类:
其他好文 时间:
2020-07-24 22:16:21
阅读次数:
68
解决方法: (1)SQL语句用as关键字给列名取别名 (2)用MyBatis提供的ResultMap标签建立实例类与表之间的关系 总结:第一种方法在SQL语句的层面上解决问题,效率高,复用性差,第二种反之; 表结构 实体类属性 private Integer userId; private Stri ...
分类:
其他好文 时间:
2020-07-24 15:25:50
阅读次数:
89
题解:用一位数代替标记数组节省空间 class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> permute(int[] nums) { List<Integer> list = ...
分类:
其他好文 时间:
2020-07-22 21:02:31
阅读次数:
87
1.“==”与equals的区别 == 是引用是否相等,equals是内容相等 Integer a = new Integer(1); Integer b = new Integer(1); if (a = b)... //错误 if(a.equals(b))... //正确 public clas ...
分类:
编程语言 时间:
2020-07-22 20:55:48
阅读次数:
80
用递归法将一个整数n转换成字符串。例如,输人483,应输出字符串”483”。n的位数不确定,可以是任意位数的整数 题目解析: 递归法求解主要要有结束条件,此题为n/10 == 0时就直接输出,其次本题还要考虑如果整数位负数的情形,此时需要输出一个字符串的负号。 #include<stdio.h> v ...
分类:
其他好文 时间:
2020-07-22 20:37:57
阅读次数:
91
Swagger使用 1、描述 Swagger 是一个规范和完整的框架,用于生成、描述、调用和可视化 RESTful 风格的 Web 服务。 作用: 1.接口的文档在线自动生成。 2.功能测试。 2、运用 a) maven导入Swagger <dependency> <groupId>io.sprin ...
分类:
其他好文 时间:
2020-07-22 20:11:14
阅读次数:
83
今天学习了包装类,除了Integer和Character其余六个类型都是首字母大写,包装类的用途:作为和基本类型数据对应的类型存在,方便涉及对象的操作,包含每种基本类型的相关属性,如最大值和最小值,以及相关的操作方法。int的包装类是Integer,两者之间可以相互转换,如Integer i=new ...
分类:
编程语言 时间:
2020-07-21 22:57:29
阅读次数:
88
@ 问题引出 要求将统计结果按照条件输出到不同文件中(分区)。 比如:将统计结果按照手机归属地不同省份输出到不同文件中(分区) 默认Partitioner分区 public class HashPartitioner<K,V> extends Partitioner<K,V>{ public int ...
分类:
其他好文 时间:
2020-07-21 22:12:05
阅读次数:
68
【原题】 Note that the memory limit is unusual. You are given a multiset consisting of nn integers. You have to process queries of two types: add integer ...
分类:
其他好文 时间:
2020-07-21 21:33:29
阅读次数:
83
解题思路:一开始不知道怎么下手,暴力遍历也没有合适的方法。参考了题解,了解到回溯算法,结合他人的代码,写了出来 借用题解的决策树图: 1 //参考了题解的回溯算法 2 public static List<List<Integer>> combinationSum(int[] candidates, ...
分类:
其他好文 时间:
2020-07-21 01:00:33
阅读次数:
67