How to do swap ping?

how to swap these elements

@kartik-malik,
You can just use the swap() function in STL.

1 Like


my code is not working

@kartik-malik,
You should try dry run on paper and pen.

1 Like

thanks it worked…