comefrom: <awangdev>46. Permutations_3.java
code: private void dfs(List<List<Integer>> result, List<Integer> list, int[] nums, boolean[] visited) {
  
          if (list.size() == nums.length) {
              result.add(new ArrayList<>(list));
              return;
          }
          for (int i = 0; i < nums.length; i++) { 
              if (visited[i]) continue;
              list.add(nums[i]);
              visited[i] = true;
  
              dfs(result, list, nums, visited);
              
              list.remove(list.size() - 1);
              visited[i] = false;
          }
      }
masked: private void sample_funcname ( List < List < Integer >> result , List < Integer > list , int [ ] nums , boolean [ ] visited ) {
    if ( list . size ( ) == nums . length ) {
      result . add ( new ArrayList < > ( list ) ) ;
      return ;
    }
    for ( int i = 0 ;
    i < nums . length ;
    i ++ ) {
      if ( visited [ i ] ) continue ;
      list . add ( nums [ i ] ) ;
      visited [ i ] = true ;
      dfs ( result , list , nums , visited ) ;
      list . remove ( list . size ( ) - 1 ) ;
      visited [ i ] = false ;
    }
  }
  