Your question is Swap Integers In Place. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Oracle Cloud Infrastructure code may need to exchange two integer state values during an update. Implement a function that swaps two integers in place without declaring an explicit temporary variable.
Because Python integers are immutable and passed by object reference, the function should return the two values in swapped order. The restriction applies to the implementation: do not use a third named variable, arithmetic storage variable, or a library swap utility.
Implement swap_in_place(a, b), where a and b are integers. Return a two-element tuple (b, a), representing the values after the swap. The inputs may be positive, negative, or zero.
a and b are integers.-10^18 <= a, b <= 10^18.def swap_in_place(a, b):