swap nodes in pairs solution