AlgorithmsGeneral

Swap two numbers without temp variables

JavaScript Solution & Complexity Analysis

Run & test in browser
JavaScript Lab Sandbox
function solution(a, b) {
  a = a + b;
  a = a - b;
  b = 
}
Console Output
Click "Run Code" above to execute and view output...