Swift 全排列经典算法

func permutations3(_ arr: inout [Int], start: Int, end: Int) {
    if start == end - 1 { // if start equal to last element, meaning nothing need to be swap anymore
        print(arr) // output the array
    } else {
        for current in start..

你可能感兴趣的:(Swift,iOS)