摘要:
给定一个没有重复数字的序列,返回其所有可能的全排列。示例:输入: [1,2,3]输出:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]class Solution { boolean[] used; List<List<Integer>> 阅读全文
posted @ 2019-08-28 19:36
小路不会迷路
阅读(248)
评论(0)
推荐(0)
摘要:
77. 组合 给定两个整数 n 和 k,返回 1 ... n 中所有可能的 k 个数的组合。示例:输入: n = 4, k = 2输出:[ [2,4], [3,4],[2,3],[1,2],[1,3],[1,4],]class Solution { List<List<Integer>> res=n 阅读全文
posted @ 2019-08-28 19:35
小路不会迷路
阅读(188)
评论(0)
推荐(0)