Too tricky. Using temp variables to swap values avoids int overflow.