SWAP variable Values without using any thread variable in swift

// frequently ask in Interview
var variableOne = 10
var variableTwo = 15

func swapValues(vOne : Int , vTwo : int) -> vOne , vTwo
{
    vOne ^= vTwo
    vTwo ^= vOne
    vOne ^= vTwo
    return vOne, vTwo
}

Comments

Popular posts from this blog

Windows Keys

Important extensions while create a new App in swift

How to Create SceneDelegate object in swift 5 Xcode 11*