leetcode刷題之旅(46)全排列

題目描述 給定一個沒有重複數字的序列,返回其所有可能的全排列。   樣例 輸入: [1,2,3] 輸出: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ]   思路分析 典型的回溯法,注意剪枝   代碼及結果 public List<List<Integer>> permute(int[] nums) {
相關文章
相關標籤/搜索