Create temporary variable for readability

#1

A[i], A[perm[next]] = A[perm[next]], A[i]

How about creating a temporary to store the replaced element instead of storing it in A[i]?
It seems so confusing to me while it.

0 Likes