Advertisement
HellFinger

Untitled

May 29th, 2019
1,490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 0.53 KB | None | 0 0
  1. function All_repl(unused::Array, prefix::Array, iteration::Int64, length::Int64)
  2.         result = []
  3.    
  4.     if iteration == 1
  5.         #print(prefix)
  6.         return prefix
  7.     else
  8.         for i in unused
  9.             x = All_repl(delete(unused, i), add(prefix, i), iteration - 1, length)
  10.                 if iteration == 2
  11.                     push!(result, x)
  12.                
  13.                 else
  14.                     append!(result, x)
  15.                 end
  16.            
  17.         end
  18.             return result
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement